-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from coldsurfers/release/surf-tree-v1.0.3
release(surf-tree): 🎨 v1.0.3
- Loading branch information
Showing
13 changed files
with
122 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
'use client' | ||
|
||
import { useLayoutEffect } from 'react' | ||
|
||
const TIME_DURATION = 5000 | ||
|
||
const TITLE = 'Welcome to SurfTree' | ||
const SUBTITLE = 'Moving to COLDSURF main page in 5 seconds' | ||
|
||
export default function Home() { | ||
return null | ||
useLayoutEffect(() => { | ||
setTimeout(() => { | ||
window.location.href = 'https://coldsurf.io' | ||
}, TIME_DURATION) | ||
}, []) | ||
|
||
return ( | ||
<> | ||
<h1>{TITLE}</h1> | ||
<h2>{SUBTITLE}</h2> | ||
</> | ||
) | ||
} |
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,2 @@ | ||
export * from './link-items' | ||
export * from './share-modal' |
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 @@ | ||
export * from './link-items' |
35 changes: 35 additions & 0 deletions
35
apps/surf-tree/src/app/shevil/(components)/link-items/link-items.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use client' | ||
|
||
import { useShallow } from 'zustand/shallow' | ||
import { shevilData } from '../../(data)' | ||
import { useCommonStore } from '../../(stores)' | ||
import { HighlightedLink, LinkItem, LinkItemsLayout } from '../../(ui)' | ||
import { parseYtId } from '../../(utils)' | ||
|
||
export function LinkItems() { | ||
const { setSharedLink, toggleShareModalVisible } = useCommonStore( | ||
useShallow((state) => ({ | ||
toggleShareModalVisible: state.toggleShareModalVisible, | ||
setSharedLink: state.setSharedLink, | ||
})), | ||
) | ||
return ( | ||
<LinkItemsLayout> | ||
{shevilData.links.map((link) => | ||
link.isHighlighted ? ( | ||
<HighlightedLink key={link.title} type="youtube" youtubeId={parseYtId(link.url) ?? ''} title={link.title} /> | ||
) : ( | ||
<LinkItem | ||
key={link.title} | ||
href={link.url} | ||
title={link.title} | ||
onClickShare={() => { | ||
toggleShareModalVisible() | ||
setSharedLink(link) | ||
}} | ||
/> | ||
), | ||
)} | ||
</LinkItemsLayout> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
apps/surf-tree/src/app/shevil/(components)/share-modal/index.ts
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 @@ | ||
export * from './share-modal' |
26 changes: 26 additions & 0 deletions
26
apps/surf-tree/src/app/shevil/(components)/share-modal/share-modal.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use client' | ||
|
||
import { useShallow } from 'zustand/shallow' | ||
import { useCommonStore } from '../../(stores)' | ||
import { ShareModal as ShareModalUI } from '../../(ui)' | ||
|
||
export function ShareModal() { | ||
const { shareModalVisible, sharedLink, toggleShareModalVisible, setSharedLink } = useCommonStore( | ||
useShallow((state) => ({ | ||
shareModalVisible: state.isShareModalVisible, | ||
sharedLink: state.sharedLink, | ||
toggleShareModalVisible: state.toggleShareModalVisible, | ||
setSharedLink: state.setSharedLink, | ||
})), | ||
) | ||
return ( | ||
<ShareModalUI | ||
visible={shareModalVisible} | ||
sharedLink={sharedLink} | ||
onClose={() => { | ||
toggleShareModalVisible() | ||
setSharedLink(null) | ||
}} | ||
/> | ||
) | ||
} |
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,16 @@ | ||
import { create } from 'zustand' | ||
import { Link } from '../(data)/data.types' | ||
|
||
export type CommonStore = { | ||
isShareModalVisible: boolean | ||
toggleShareModalVisible: () => void | ||
sharedLink: Link | null | ||
setSharedLink: (link: Link | null) => void | ||
} | ||
|
||
export const useCommonStore = create<CommonStore>((set) => ({ | ||
isShareModalVisible: false, | ||
toggleShareModalVisible: () => set((state) => ({ isShareModalVisible: !state.isShareModalVisible })), | ||
sharedLink: null, | ||
setSharedLink: (link: Link | null) => set({ sharedLink: link }), | ||
})) |
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 @@ | ||
export * from './common-store' |
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 was deleted.
Oops, something went wrong.
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,52 +1,25 @@ | ||
'use client' | ||
|
||
import { useState } from 'react' | ||
import { Metadata } from 'next/types' | ||
import { LinkItems, ShareModal } from './(components)' | ||
import { shevilData } from './(data)' | ||
import { Link } from './(data)/data.types' | ||
import { useToggle } from './(hooks)' | ||
import { HeroInfo, HighlightedLink, LinkItem, LinkItemsLayout, PageLayout, ShareModal, TopCard } from './(ui)' | ||
import { parseYtId } from './(utils)' | ||
import { HeroInfo, PageLayout, TopCard } from './(ui)' | ||
|
||
export default function ShevilPage() { | ||
const [shareModalVisible, toggleShareModalVisible] = useToggle() | ||
const [sharedLink, setSharedLink] = useState<Link | null>(null) | ||
export const metadata: Metadata = { | ||
title: 'Shevil | SurfTree', | ||
description: shevilData.subtitle, | ||
icons: { | ||
icon: '/icons/favicon.ico', | ||
}, | ||
} | ||
|
||
export default function ShevilPage() { | ||
return ( | ||
<> | ||
<PageLayout> | ||
<TopCard backgroundImageUrl={shevilData.profileImageUrl} /> | ||
<HeroInfo title={shevilData.title} subtitle={shevilData.subtitle} /> | ||
<LinkItemsLayout> | ||
{shevilData.links.map((link) => | ||
link.isHighlighted ? ( | ||
<HighlightedLink | ||
key={link.title} | ||
type="youtube" | ||
youtubeId={parseYtId(link.url) ?? ''} | ||
title={link.title} | ||
/> | ||
) : ( | ||
<LinkItem | ||
key={link.title} | ||
href={link.url} | ||
title={link.title} | ||
onClickShare={() => { | ||
toggleShareModalVisible() | ||
setSharedLink(link) | ||
}} | ||
/> | ||
), | ||
)} | ||
</LinkItemsLayout> | ||
<LinkItems /> | ||
</PageLayout> | ||
<ShareModal | ||
visible={shareModalVisible} | ||
sharedLink={sharedLink} | ||
onClose={() => { | ||
toggleShareModalVisible() | ||
setSharedLink(null) | ||
}} | ||
/> | ||
<ShareModal /> | ||
</> | ||
) | ||
} |
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