Skip to content

Commit

Permalink
Merge branch 'main' into feature/navigation-bar-and-footer
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderl19 authored Sep 6, 2023
2 parents d20091a + dd3aad0 commit f2655d0
Show file tree
Hide file tree
Showing 12 changed files with 240 additions and 199 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy Preview

on:
pull_request:

permissions:
contents: read
pull-requests: write

jobs:
Site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@v25
with:
vercel-version: 30.2.2
github-comment: |
<table>
<tr>
<td><strong>Name</strong></td>
<td>Hack at UCI Site</td>
</tr>
<tr>
<td><strong>Preview</strong></td>
<td><a href='{{deploymentUrl}}'>Visit Preview</a></td>
</tr>
<tr>
<td><strong>Commit</strong></td>
<td>{{deploymentCommit}}</td>
</tr>
</table>
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID}}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_SITE}}
Studio:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@v25
with:
vercel-version: 30.2.2
github-comment: |
<table>
<tr>
<td><strong>Name</strong></td>
<td>Sanity Studio</td>
</tr>
<tr>
<td><strong>Preview</strong></td>
<td><a href='{{deploymentUrl}}'>Visit Preview</a></td>
</tr>
<tr>
<td><strong>Commit</strong></td>
<td>{{deploymentCommit}}</td>
</tr>
</table>
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID}}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_STUDIO}}
36 changes: 36 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy Production

on:
push:
branches:
- main

permissions:
contents: read
pull-requests: write

jobs:
Site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@v25
with:
vercel-version: 30.2.2
github-comment: false
vercel-args: "--prod"
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID}}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_SITE}}
Studio:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@v25
with:
vercel-version: 30.2.2
github-comment: false
vercel-args: "--prod"
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID}}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_STUDIO}}
5 changes: 3 additions & 2 deletions apps/sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
"sanity"
],
"dependencies": {
"@sanity/icons": "^2.4.1",
"@portabletext/react": "^3.0.7",
"@sanity/vision": "^3.15.1",
"lucide-react": "^0.271.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
Expand All @@ -33,4 +34,4 @@
"prettier": "^2.8.8",
"typescript": "^4.9.5"
}
}
}
23 changes: 22 additions & 1 deletion apps/sanity/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { deskTool } from "sanity/desk";
import { visionTool } from "@sanity/vision";
import { media } from "sanity-plugin-media";
import { schemaTypes } from "./schemas";
import { BadgeHelp } from "lucide-react";

export default defineConfig({
name: "default",
Expand All @@ -11,7 +12,27 @@ export default defineConfig({
projectId: "1smqaeyk",
dataset: "production",

plugins: [deskTool(), visionTool(), media()],
plugins: [
deskTool({
structure: (S) =>
S.list()
.title("Content")
.items([
S.listItem()
.title("FAQs")
.icon(BadgeHelp)
.child(
S.document().schemaType("faqs").documentId("faqs").title("FAQs")
),
S.divider(),
...S.documentTypeListItems().filter(
(listItem) => !["faqs"].includes(listItem.getId()!)
),
]),
}),
visionTool(),
media(),
],

schema: {
types: schemaTypes,
Expand Down
42 changes: 0 additions & 42 deletions apps/sanity/schemas/clipboard.ts

This file was deleted.

55 changes: 55 additions & 0 deletions apps/sanity/schemas/faqs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { defineType, defineField, defineArrayMember } from "sanity";
import { toPlainText } from "@portabletext/react";
import { FileQuestion } from "lucide-react";

export default defineType({
name: "faqs",
title: "FAQs",
type: "document",
fields: [
defineField({
name: "faqs",
title: "FAQs",
type: "array",
of: [
defineArrayMember({
type: "object",
name: "faq",
fields: [
defineField({
name: "question",
title: "Question",
type: "text",
}),
defineField({
name: "answer",
title: "Answer",
type: "array",
of: [
{
type: "block",
styles: [{ title: "Normal", value: "normal" }],
lists: [],
},
],
}),
],

preview: {
select: {
title: "question",
subtitle: "answer",
},
prepare({ title, subtitle }) {
return {
title,
subtitle: subtitle ? toPlainText(subtitle) : undefined,
media: FileQuestion,
};
},
},
}),
],
}),
],
});
8 changes: 2 additions & 6 deletions apps/sanity/schemas/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import stickers from "./stickers";
import notes from "./notes";
import clipboard from "./clipboard";
import tags from "./tags";
import paper from "./paper";
import faqs from "./faqs";

export const schemaTypes = [stickers, notes, clipboard, paper, tags];
export const schemaTypes = [faqs];
36 changes: 0 additions & 36 deletions apps/sanity/schemas/notes.ts

This file was deleted.

36 changes: 0 additions & 36 deletions apps/sanity/schemas/paper.ts

This file was deleted.

36 changes: 0 additions & 36 deletions apps/sanity/schemas/stickers.ts

This file was deleted.

14 changes: 0 additions & 14 deletions apps/sanity/schemas/tags.ts

This file was deleted.

Loading

0 comments on commit f2655d0

Please sign in to comment.