-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dashboard): all sites area (#566)
* feat: site card * fix: remove create project button * feat: add menu story * fix: menu item and link * fix: add focus border to card * fix: add focus visible to sidebar nav item * fix: user menu * fix: add usage threshold * feat: site card menu * fix(dashboard): mobile style * feat: empty site card
- Loading branch information
Showing
18 changed files
with
239 additions
and
267 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import clsx from 'clsx'; | ||
import * as React from 'react'; | ||
|
||
import { Card, Link, IconPlus, Text } from '../../components'; | ||
import { cardStyle } from './site-card'; | ||
|
||
export function EmptySiteCard(): JSX.Element { | ||
return ( | ||
<Card | ||
as={Link} | ||
href={`/site/create`} | ||
variant="plain" | ||
className={clsx( | ||
'flex flex-col items-center justify-center border-2 border-dashed !border-primary-600 shadow-primary-400 hover:shadow-primary-400', | ||
cardStyle, | ||
)} | ||
> | ||
<div className="mb-4 flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-full border-8 border-primary-300 bg-primary-500 text-primary-900"> | ||
<IconPlus /> | ||
</div> | ||
<Text className="mb-1 font-semibold text-primary-900"> | ||
Create new site | ||
</Text> | ||
<Text size="sm">Connect your Notion database and go live</Text> | ||
</Card> | ||
); | ||
} |
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,68 @@ | ||
import { | ||
IconExternalLink, | ||
IconGlobe, | ||
IconLayers, | ||
IconMoreVertical, | ||
IconPieChart, | ||
IconSettings, | ||
Menu, | ||
} from '../../components'; | ||
import { RouterOutputs } from '../../utilities'; | ||
import { MenuLink } from '../user-menu/menu-link'; | ||
|
||
export function SiteCardMenu({ | ||
site, | ||
}: { | ||
site: RouterOutputs['site']['all'][number]; | ||
}): JSX.Element { | ||
const siteHome = `/site/${site.subdomain}`; | ||
const links = [ | ||
{ | ||
name: 'Site home', | ||
href: siteHome, | ||
// TODO: should be double layer | ||
icon: IconLayers, | ||
}, | ||
{ | ||
name: 'Live', | ||
href: `https://${site.subdomain}.chirpy.dev`, | ||
icon: IconExternalLink, | ||
}, | ||
{ | ||
name: 'Analytics', | ||
href: `${siteHome}/analytics`, | ||
icon: IconPieChart, | ||
}, | ||
{ | ||
name: 'Domain', | ||
href: `${siteHome}/domain`, | ||
icon: IconGlobe, | ||
}, | ||
{ | ||
name: 'Settings', | ||
href: `${siteHome}/settings`, | ||
icon: IconSettings, | ||
}, | ||
]; | ||
|
||
return ( | ||
<Menu> | ||
<Menu.Button className="ml-auto"> | ||
<IconMoreVertical size={20} /> | ||
</Menu.Button> | ||
<Menu.Items align="start" className="min-w-[200px]"> | ||
{links.map((link) => ( | ||
<Menu.Item | ||
key={link.name} | ||
as={MenuLink} | ||
variant="plain" | ||
href={link.href} | ||
> | ||
{<link.icon size={16} />} | ||
{link.name} | ||
</Menu.Item> | ||
))} | ||
</Menu.Items> | ||
</Menu> | ||
); | ||
} |
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
Oops, something went wrong.