-
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.
* remove <head> tag added manually, use <Script> and add favicon in Metadata * remove unused code file and rename others * remove onLogin props by using <Link> tag on landing page and rename feature by logic * refactor(front): update every components * fix: error on build baseUrl fixed
- Loading branch information
1 parent
576bb0f
commit 2c69429
Showing
39 changed files
with
1,048 additions
and
1,235 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,59 +1,59 @@ | ||
"use client"; | ||
import React from "react"; | ||
import MyGistIdPage from "./page-ui"; | ||
import { | ||
useGist, | ||
usePatchGistContent, | ||
usePatchGistName, | ||
} from "@/lib/queries/gists.queries"; | ||
import { useToast } from "@/components/shadcn/use-toast"; | ||
'use client' | ||
import React from 'react' | ||
import MyGistIdPage from './page-ui' | ||
import { useGist, usePatchGistContent, usePatchGistName } from '@/lib/queries/gists.queries' | ||
import { useToast } from '@/components/shadcn/use-toast' | ||
import { useKeyPress } from '@/lib/hook/use-key-press' | ||
|
||
interface MyGistIdFeaturePageProps { | ||
params: { | ||
gistId: string; | ||
}; | ||
gistId: string | ||
} | ||
} | ||
|
||
export default function MyGistIdFeaturePage({ | ||
params, | ||
}: MyGistIdFeaturePageProps) { | ||
const { gistId } = params; | ||
const { data } = useGist(gistId); | ||
const { toast } = useToast(); | ||
export default function MyGistIdFeaturePage({ params }: MyGistIdFeaturePageProps) { | ||
const { gistId } = params | ||
const { data } = useGist(gistId) | ||
const { toast } = useToast() | ||
|
||
const { mutate: updateName } = usePatchGistName({ | ||
onSuccess: () => { | ||
toast({ | ||
title: "Gist Saved", | ||
description: "Your gist has been saved successfully", | ||
}); | ||
title: 'Gist Saved', | ||
description: 'Your gist has been saved successfully', | ||
}) | ||
}, | ||
}); | ||
}) | ||
|
||
const { mutate: updateContent } = usePatchGistContent({ | ||
onSuccess: () => { | ||
}, | ||
}); | ||
onSuccess: () => {}, | ||
}) | ||
|
||
const onDownloadClick = () => { | ||
const onDownload = () => { | ||
toast({ | ||
title: "Gist Downloaded", | ||
description: "Your gist has been downloaded successfully", | ||
}); | ||
}; | ||
const onSaveClick = (name: string, code: string) => { | ||
updateContent({ id: gistId, content: code }); | ||
|
||
updateName({ id: gistId, name }); | ||
}; | ||
title: 'Gist Downloaded', | ||
description: 'Your gist has been downloaded successfully', | ||
}) | ||
} | ||
const onSave = (name: string, code: string) => { | ||
updateContent({ id: gistId, content: code }) | ||
updateName({ id: gistId, name }) | ||
toast({ | ||
title: 'Gist Saved', | ||
description: 'Your gist has been saved successfully', | ||
}) | ||
} | ||
|
||
const onDelete = (id: string) => { | ||
console.log(`Deleting gist with ID: ${id}`) | ||
} | ||
|
||
const onShare = () => { | ||
console.log('Share') | ||
} | ||
|
||
if (!data) { | ||
return null; | ||
return null | ||
} | ||
return ( | ||
<MyGistIdPage | ||
gist={data} | ||
onDownloadClick={onDownloadClick} | ||
onSaveClick={onSaveClick} | ||
/> | ||
); | ||
return <MyGistIdPage gist={data} onDownload={onDownload} onSave={onSave} onDelete={onDelete} onShare={onShare} /> | ||
} |
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
15 changes: 15 additions & 0 deletions
15
src/app/(gistLayout)/org/[orgId]/gist/[gistId]/page-ui.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,15 @@ | ||
import GistDetails from '@/components/ui/gist-details' | ||
import { Gist } from '@/types' | ||
|
||
interface MyOrgGistIdPageProps { | ||
gist: Gist | ||
orgName: string | ||
onDownload: () => void | ||
onSave: () => void | ||
onDelete: (id: string) => void | ||
onShare: () => void | ||
} | ||
|
||
export default function MyOrgGistIdPage({ orgName, gist, onDownload, onSave, onDelete, onShare }: MyOrgGistIdPageProps) { | ||
return <GistDetails orgName={orgName} gist={gist} onDownload={onDownload} onSave={onSave} onDelete={onDelete} onShare={onShare} /> | ||
} |
Oops, something went wrong.