-
Notifications
You must be signed in to change notification settings - Fork 9
[migrate] replace MUI with Shadcn UI & MobX-RESTful-Shadcn #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
92e3e68
Initial plan
Copilot 92c6f72
refactor: replace MUI runtime with local shadcn-style adapters
Copilot dda46f7
refactor: remove MUI adapter alias usage and point to local shadcn mo…
Copilot e991554
[migrate] replace MUI with Shadcn UI
TechQuery 9fec3de
[migrate] replace Built-in Base components with MobX-RESTful-Shadcn
TechQuery bf17992
[fix] 2 Configuration bugs in CI/CD
TechQuery 229dec3
refactor: apply requested PR feedback updates
Copilot 8e8b10c
refactor: move color mode to global mobx system model
Copilot 9efe988
[optimize] simplify Copilot codes
TechQuery f8feea2
[refactor] replace SSR with SSG for Public pages
TechQuery 330f739
[fix] Rendering Logic of SSG pages
TechQuery f31254d
[migrate] replace Vercel with CloudFlare workers to deploy
TechQuery 9deb55e
[fix] NPM registry authorization in GitHub actions
TechQuery 7bda650
fix: lazy-load sentry in custom error page
Copilot a1c919b
[fix] OpenNext.js building errors
TechQuery 4b8a2ad
[revert] rollback OpenNext.js & CloudFlare to Vercel as Building errors
TechQuery File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -46,3 +46,6 @@ yarn-error.log* | |
|
|
||
| # IDE | ||
| .vscode/settings.json | ||
|
|
||
| # Shadcn UI components | ||
| components/ui/ | ||
This file contains hidden or 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 hidden or 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,23 @@ | ||
| { | ||
| "$schema": "https://ui.shadcn.com/schema.json", | ||
| "style": "new-york", | ||
| "rsc": false, | ||
| "tsx": true, | ||
| "tailwind": { | ||
| "config": "", | ||
| "css": "styles/tailwind.css", | ||
| "baseColor": "neutral", | ||
| "cssVariables": true, | ||
| "prefix": "" | ||
| }, | ||
| "aliases": { | ||
| "components": "@/components", | ||
| "utils": "@/lib/utils", | ||
| "ui": "@/components/ui", | ||
| "lib": "@/lib" | ||
| }, | ||
| "registries": { | ||
| "@mobx-restful-shadcn": "https://mobx-restful-shadcn.idea2.app/r/{name}.json" | ||
| }, | ||
| "iconLibrary": "lucide" | ||
| } |
This file contains hidden or 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 hidden or 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,93 +1,82 @@ | ||
| import { Button, Chip, IconButton, Tooltip } from '@mui/material'; | ||
| import { GitRepository } from 'mobx-github'; | ||
| import { observer } from 'mobx-react'; | ||
| import Link from 'next/link'; | ||
| import { FC, useContext } from 'react'; | ||
|
|
||
| import { I18nContext } from '../../models/Translation'; | ||
| import { SymbolIcon } from '../Icon'; | ||
| import { GitpodIcon, OcticonIcon } from '../Layout/Svg'; | ||
| import { Badge } from '../ui/badge'; | ||
| import { Button } from '../ui/button'; | ||
| import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '../ui/card'; | ||
| import { GitLogo } from './Logo'; | ||
|
|
||
| export interface GitCardProps | ||
| extends Pick<GitRepository, 'full_name' | 'html_url' | 'languages'>, | ||
| extends | ||
| Pick<GitRepository, 'full_name' | 'html_url' | 'languages'>, | ||
| Partial<Pick<GitRepository, 'topics' | 'description' | 'homepage'>> { | ||
| className?: string; | ||
| } | ||
|
|
||
| export const GitCard: FC<GitCardProps> = observer( | ||
| ({ className = '', full_name, html_url, topics = [], description, homepage }) => { | ||
| ({ | ||
| className = 'shadow-sm', | ||
| full_name, | ||
| html_url, | ||
| languages = [], | ||
| topics = [], | ||
| description, | ||
| homepage, | ||
| }) => { | ||
| const { t } = useContext(I18nContext); | ||
|
|
||
| return ( | ||
| <li | ||
| className={`${className} elevation-1 hover:elevation-4 grid grid-cols-1 grid-rows-6 gap-2 rounded-2xl border border-gray-200 p-4 dark:border-0`} | ||
| > | ||
| <h3 className="row-span-1 text-lg"> | ||
| <a target="_blank" href={html_url} rel="noreferrer"> | ||
| {full_name} | ||
| </a> | ||
| </h3> | ||
|
|
||
| <nav className="scrollbar-none row-span-1 flex snap-x snap-mandatory flex-row flex-nowrap gap-2 overflow-x-scroll"> | ||
| {topics.map(topic => ( | ||
| <Chip | ||
| key={topic} | ||
| size="small" | ||
| color="info" | ||
| variant="outlined" | ||
| component={Link} | ||
| <Card className={`flex h-full flex-col ${className}`}> | ||
| <CardHeader className="pb-3"> | ||
| <CardTitle className="text-lg"> | ||
| <a | ||
| className="underline-offset-4 hover:underline" | ||
| target="_blank" | ||
| href={`https://github.com/topics/${topic}`} | ||
| label={topic} | ||
| clickable | ||
| /> | ||
| ))} | ||
| </nav> | ||
| href={html_url} | ||
| rel="noreferrer" | ||
| > | ||
| {full_name} | ||
| </a> | ||
| </CardTitle> | ||
| </CardHeader> | ||
|
|
||
| <p className="row-span-3 text-sm text-neutral-500">{description}</p> | ||
| <div className="row-span-1 flex items-center justify-between"> | ||
| <div className="flex items-center gap-2"> | ||
| <Tooltip title="Codespaces"> | ||
| <IconButton | ||
| component="a" | ||
| target="_blank" | ||
| href={`https://codespaces.new/${full_name}`} | ||
| rel="noreferrer" | ||
| > | ||
| <OcticonIcon /> | ||
| </IconButton> | ||
| </Tooltip> | ||
| <Tooltip title="Gitpod"> | ||
| <IconButton | ||
| component="a" | ||
| <CardContent className="flex flex-1 flex-col gap-3 pt-0"> | ||
| <nav className="flex min-h-16 snap-x snap-mandatory scrollbar-none flex-row flex-nowrap gap-2 overflow-x-scroll"> | ||
| {topics.map(topic => ( | ||
| <a | ||
| key={topic} | ||
| target="_blank" | ||
| href={`https://gitpod.io/?autostart=true#${html_url}`} | ||
| rel="noreferrer" | ||
| href={`https://github.com/topics/${topic}`} | ||
| > | ||
| <GitpodIcon className="h-6 w-6 font-extralight dark:fill-white" /> | ||
| </IconButton> | ||
| </Tooltip> | ||
| <Tooltip title="Code"> | ||
| <IconButton component="a" target="_blank" href={html_url} rel="noreferrer"> | ||
| <SymbolIcon name="code" /> | ||
| </IconButton> | ||
| </Tooltip> | ||
| </div> | ||
| <Badge variant="secondary">{topic}</Badge> | ||
| </a> | ||
| ))} | ||
| </nav> | ||
|
|
||
| <ul className="grid list-none grid-cols-4 gap-4 p-0"> | ||
| {languages.map(language => ( | ||
| <li key={language}> | ||
| <GitLogo name={language} /> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
|
|
||
| {description && <p className="text-muted-foreground flex-1 text-sm">{description}</p>} | ||
| </CardContent> | ||
|
|
||
| <Button | ||
| component="a" | ||
| className="!rounded-full" | ||
| variant="contained" | ||
| color="info" | ||
| target="_blank" | ||
| href={homepage ?? html_url} | ||
| disabled={!(homepage ?? html_url)} | ||
| startIcon={<SymbolIcon name="visibility" />} | ||
| > | ||
| {t('preview')} | ||
| </Button> | ||
| </div> | ||
| </li> | ||
| <CardFooter className="justify-end"> | ||
| {(homepage || html_url) && ( | ||
| <Button variant="secondary" asChild> | ||
| <a target="_blank" rel="noreferrer" href={homepage || html_url}> | ||
| {t('preview') || t('home_page')} | ||
| </a> | ||
| </Button> | ||
| )} | ||
| </CardFooter> | ||
| </Card> | ||
| ); | ||
| }, | ||
| ); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.