-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:HackAtUCI/zothacks-site-2023 into u…
…pdate/resources-sanity
- Loading branch information
Showing
34 changed files
with
604 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import faqs from "./faqs"; | ||
import event from "./event"; | ||
import resource from "./resource"; | ||
import sponsors from "./sponsors"; | ||
|
||
export const schemaTypes = [faqs, event, resource]; | ||
export const schemaTypes = [faqs, event, resource, sponsors]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { defineType, defineField, defineArrayMember } from "sanity"; | ||
import { HeartHandshake } from "lucide-react"; | ||
|
||
export default defineType({ | ||
name: "sponsors", | ||
title: "Sponsors", | ||
icon: HeartHandshake, | ||
type: "document", | ||
fields: [ | ||
defineField({ | ||
name: "sponsors", | ||
title: "Sponsors", | ||
type: "array", | ||
of: [ | ||
defineArrayMember({ | ||
type: "object", | ||
name: "sponsor", | ||
fields: [ | ||
defineField({ | ||
name: "name", | ||
title: "Name", | ||
type: "string", | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: "url", | ||
title: "URL", | ||
type: "url", | ||
}), | ||
defineField({ | ||
name: "tier", | ||
title: "Tier", | ||
type: "string", | ||
options: { | ||
list: [ | ||
{ | ||
title: "Bronze", | ||
value: "bronze", | ||
}, | ||
{ | ||
title: "Silver", | ||
value: "silver", | ||
}, | ||
], | ||
layout: "radio", | ||
direction: "vertical", | ||
}, | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
defineField({ | ||
name: "logo", | ||
title: "Logo", | ||
type: "image", | ||
validation: (Rule) => Rule.required(), | ||
}), | ||
], | ||
}), | ||
], | ||
}), | ||
], | ||
}); |
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.stickerContainer { | ||
.sticker { | ||
cursor: grab; | ||
position: absolute; | ||
z-index: 100; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
apps/site/src/components/Sticker/StickerPosition.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.stickerPosition { | ||
position: relative; | ||
display: flex; | ||
justify-content: center; | ||
width: max-content; | ||
} | ||
|
||
.stickerParent { | ||
position: relative; | ||
width: 0; | ||
height: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import type { StickerProps } from "./Stickers/stickerProps"; | ||
import styles from "./StickerPosition.module.scss"; | ||
|
||
interface Sticker { | ||
Node: React.ComponentType<StickerProps>; | ||
positionX?: "left" | "right"; | ||
positionY?: "top" | "bottom"; | ||
offsetX?: number; | ||
offsetY?: number; | ||
} | ||
|
||
const StickerParent: React.FC<Sticker> = ({ | ||
Node, | ||
positionY = "top", | ||
offsetX, | ||
offsetY, | ||
}) => ( | ||
<div | ||
className={styles.stickerParent} | ||
style={{ | ||
alignSelf: positionY === "top" ? "flex-start" : "flex-end", | ||
}} | ||
> | ||
<Node offsetX={offsetX} offsetY={offsetY} /> | ||
</div> | ||
); | ||
|
||
interface StickerPositionProps { | ||
children?: React.ReactNode; | ||
stickers: Sticker[]; | ||
} | ||
|
||
const StickerPosition: React.FC<StickerPositionProps> = ({ | ||
children, | ||
stickers, | ||
}) => { | ||
return ( | ||
<div className={styles.stickerPosition}> | ||
{stickers | ||
.filter(({ positionX }) => !positionX || positionX === "left") | ||
.map((sticker) => ( | ||
// eslint-disable-next-line react/jsx-key | ||
<StickerParent {...sticker} /> | ||
))} | ||
{children} | ||
{stickers | ||
.filter(({ positionX }) => positionX === "right") | ||
.map((sticker) => ( | ||
// eslint-disable-next-line react/jsx-key | ||
<StickerParent {...sticker} /> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default StickerPosition; |
3 changes: 0 additions & 3 deletions
3
apps/site/src/components/Sticker/Stickers/HackSticker/HackSticker.module.scss
This file was deleted.
Oops, something went wrong.
28 changes: 14 additions & 14 deletions
28
apps/site/src/components/Sticker/Stickers/HackSticker/HackSticker.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import type React from "react"; | ||
import type { StickerProps } from "../stickerProps"; | ||
import HackLogo from "@/assets/icons/hack.png"; | ||
import BaseSticker from "../../BaseSticker"; | ||
import styles from "./HackSticker.module.scss"; | ||
import { lightShake } from "@/components/animation"; | ||
|
||
export default function HackSticker({ style }: { style?: object | undefined }) { | ||
return ( | ||
<div className={styles.stickerContainer} style={{ ...style }}> | ||
<BaseSticker | ||
imageSrc={HackLogo.src} | ||
alt="Hack at UCI sticker" | ||
height={200} | ||
width={200} | ||
{...lightShake} | ||
/> | ||
</div> | ||
); | ||
} | ||
const HackSticker: React.FC<StickerProps> = (props) => ( | ||
<BaseSticker | ||
imageSrc={HackLogo.src} | ||
alt="Hack at UCI sticker" | ||
height={200} | ||
width={200} | ||
{...lightShake} | ||
{...props} | ||
/> | ||
); | ||
|
||
export default HackSticker; |
Oops, something went wrong.