forked from tailwarden/komiser
-
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 tailwarden#1486 from tailwarden/develop
v3.1.19 release π
- Loading branch information
Showing
39 changed files
with
2,586 additions
and
5,442 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import { StarIcon } from '@components/icons'; | ||
import formatNumber from '@utils/formatNumber'; | ||
import Image from 'next/image'; | ||
import { BannerProps } from './Banner'; | ||
|
||
const base: BannerProps = { | ||
children: 'Banner Content', | ||
displayBanner: true, | ||
dismissBanner: () => {} | ||
}; | ||
|
||
const primary: BannerProps = { | ||
children: ( | ||
<> | ||
<span className="text-sm font-medium"> | ||
Support Komiser by giving us a star on GitHub. | ||
</span> | ||
|
||
<a | ||
href="https://github.com/tailwarden/komiser" | ||
target="_blank" | ||
rel="noreferrer" | ||
className="group flex items-center gap-3 rounded border-[1.5px] border-white pl-4 text-sm text-white transition-colors hover:bg-white/10" | ||
> | ||
<Image | ||
src="/assets/img/others/github-white.svg" | ||
width="18" | ||
height="16" | ||
alt="Github logo" | ||
/> | ||
<span>Star Komiser</span> | ||
<div className="flex h-full items-center justify-center gap-2 border-l border-white/10 bg-white/10 px-3 py-2.5"> | ||
<StarIcon | ||
width={16} | ||
height={16} | ||
className="group-hover:fill-orange-400 group-hover:text-orange-400" | ||
/> | ||
{formatNumber(100000)} | ||
</div> | ||
</a> | ||
</> | ||
), | ||
displayBanner: true, | ||
dismissBanner: () => {} | ||
}; | ||
|
||
const secondary: BannerProps = { | ||
children: ( | ||
<> | ||
<span className="text-sm font-medium"> | ||
Support Komiser by giving us a star on GitHub. | ||
</span> | ||
|
||
<a | ||
href="https://github.com/tailwarden/komiser" | ||
target="_blank" | ||
rel="noreferrer" | ||
className="group flex items-center gap-3 rounded border-[1.5px] border-darkcyan-500 text-darkcyan-500 pl-4 text-sm transition-colors hover:bg-black/10" | ||
> | ||
<Image | ||
src="/assets/img/others/github-black.svg" | ||
width="18" | ||
height="16" | ||
alt="Github logo" | ||
/> | ||
<span>Star Komiser</span> | ||
<div className="flex h-full items-center justify-center gap-2 border-l border-black/10 bg-black/10 px-3 py-2.5"> | ||
<StarIcon | ||
width={16} | ||
height={16} | ||
className="group-hover:fill-orange-400 group-hover:text-orange-400" | ||
/> | ||
{formatNumber(100000)} | ||
</div> | ||
</a> | ||
</> | ||
), | ||
displayBanner: true, | ||
dismissBanner: () => {}, | ||
style: 'secondary' | ||
}; | ||
|
||
const mockBannerProps = { | ||
base, | ||
primary, | ||
secondary | ||
}; | ||
|
||
export default mockBannerProps; |
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,30 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import Banner from './Banner'; | ||
import mockBannerProps from './Banner.mocks'; | ||
|
||
const meta: Meta<typeof Banner> = { | ||
title: 'Komiser/Banner', | ||
component: Banner, | ||
tags: ['autodocs'] | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Banner>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
...mockBannerProps.base | ||
} | ||
}; | ||
|
||
export const Primary: Story = { | ||
args: { | ||
...mockBannerProps.primary | ||
} | ||
}; | ||
|
||
export const Secondary: Story = { | ||
args: { | ||
...mockBannerProps.secondary | ||
} | ||
}; |
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
49 changes: 49 additions & 0 deletions
49
dashboard/components/layout/components/github-banner/GithubBanner.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,49 @@ | ||
import Banner from '@components/banner/Banner'; | ||
import { StarIcon } from '@components/icons'; | ||
import GlobalAppContext from '@components/layout/context/GlobalAppContext'; | ||
import Image from 'next/image'; | ||
import { useContext } from 'react'; | ||
import formatNumber from '../../../../utils/formatNumber'; | ||
|
||
type GithubBannerProps = { | ||
githubStars: number | undefined; | ||
}; | ||
|
||
function GithubBanner({ githubStars }: GithubBannerProps) { | ||
const { displayBanner, dismissBanner } = useContext(GlobalAppContext); | ||
|
||
return ( | ||
<Banner displayBanner={displayBanner} dismissBanner={dismissBanner}> | ||
<span className="text-sm font-medium"> | ||
Support Komiser by giving us a star on GitHub. | ||
</span> | ||
|
||
{githubStars && ( | ||
<a | ||
href="https://github.com/tailwarden/komiser" | ||
target="_blank" | ||
rel="noreferrer" | ||
className="group flex items-center gap-3 rounded border-[1.5px] border-white pl-4 text-sm text-white transition-colors hover:bg-white/10" | ||
> | ||
<Image | ||
src="/assets/img/others/github-white.svg" | ||
width="18" | ||
height="16" | ||
alt="Github logo" | ||
/> | ||
<span>Star Komiser</span> | ||
<div className="flex h-full items-center justify-center gap-2 border-l border-white/10 bg-white/10 px-3 py-2.5"> | ||
<StarIcon | ||
width={16} | ||
height={16} | ||
className="group-hover:fill-orange-400 group-hover:text-orange-400" | ||
/> | ||
{formatNumber(githubStars)} | ||
</div> | ||
</a> | ||
)} | ||
</Banner> | ||
); | ||
} | ||
|
||
export default GithubBanner; |
File renamed without changes.
Oops, something went wrong.