-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move stream in sidebar to right-side
- Loading branch information
1 parent
0eb140f
commit 32cc517
Showing
3 changed files
with
31 additions
and
18 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,17 +1,27 @@ | ||
import cn from "clsx"; | ||
import { ReactNode } from "react"; | ||
import { ReactElement, ReactNode } from "react"; | ||
|
||
export function withStream(text: ReactNode): ReactNode { | ||
export function StreamTag({ small = false }: { small?: boolean }): ReactElement { | ||
return ( | ||
<span | ||
className={cn( | ||
"uppercase font-mono flex items-center leading-none bg-accent-primary/10 dark:bg-accent-primary-dark/10 text-accent-primary dark:text-accent-primary-dark", | ||
{ | ||
["py-1 px-1.5 rounded-md h-5 text-[10px]"]: small, | ||
["py-1 px-2 rounded-lg h-6 text-xs"]: !small, | ||
}, | ||
)} | ||
> | ||
{"STREAM"} | ||
</span> | ||
); | ||
} | ||
|
||
export function withStream(text: ReactNode, small?: boolean): ReactNode { | ||
return ( | ||
<span className="inline-flex items-baseline gap-2"> | ||
<span>{text}</span> | ||
<span | ||
className={cn( | ||
"uppercase font-mono flex items-center text-xs leading-none bg-accent-primary/10 dark:bg-accent-primary-dark/10 text-accent-primary dark:text-accent-primary-dark p-0.5 rounded-[4px]", | ||
)} | ||
> | ||
{"STREAM"} | ||
</span> | ||
<StreamTag small={small} /> | ||
</span> | ||
); | ||
} |
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