-
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.
feat: darkmode, pinned resources, optimized UI
Closes SUP-2068 Closes SUP-2069 Closes SUP-2072 Closes SUP-2071
- Loading branch information
Showing
37 changed files
with
3,071 additions
and
364 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,51 +1,32 @@ | ||
import { PropsWithChildren } from "react"; | ||
import { useTheme } from "next-themes"; | ||
|
||
const AtomTitle = ({ | ||
children, | ||
alignText = "left", | ||
inverted = false, | ||
ignoreDarkMode = false, | ||
subtitle = "", | ||
}: PropsWithChildren<{ | ||
alignText?: string; | ||
inverted?: boolean; | ||
ignoreDarkMode?: boolean; | ||
subtitle?: string; | ||
}>) => { | ||
const colorClass = inverted | ||
? "from-pink-50 to-pink-300" | ||
: "from-pink-500 to-pink-900"; | ||
const subtitleColorClass = inverted ? "text-pink-50" : "text-pink-600"; | ||
const flexJustify = | ||
alignText === "left" | ||
? "justify-start" | ||
: alignText === "right" | ||
? "justify-end" | ||
: "justify-center"; | ||
const { theme } = useTheme(); | ||
const invertedBasedOnTheme = ignoreDarkMode ? inverted : theme === "dark" ? !inverted : inverted; | ||
const colorClass = invertedBasedOnTheme ? "from-pink-50 to-pink-300" : "from-pink-500 to-pink-900"; | ||
const subtitleColorClass = invertedBasedOnTheme ? "text-pink-50" : "text-pink-600"; | ||
const flexJustify = alignText === "left" ? "justify-start" : alignText === "right" ? "justify-end" : "justify-center"; | ||
const alignTextClass = `text-${alignText}`; | ||
return ( | ||
<div | ||
className={`${alignTextClass} mb-8 w-auto space-y-3 ${flexJustify}`} | ||
data-aos="fade-up" | ||
data-aos-delay="100" | ||
> | ||
<h2 | ||
className={`text-2xl font-extrabold tracking-tight md:max-w-full md:text-3xl ${alignTextClass}`} | ||
data-aos="slide-up" | ||
> | ||
<span | ||
className={`-mb-1 block bg-gradient-to-r pb-1 ${colorClass} relative bg-clip-text text-transparent`} | ||
> | ||
{children} | ||
</span> | ||
<div className={`${alignTextClass} mb-8 w-auto space-y-3 ${flexJustify}`} data-aos="fade-up" data-aos-delay="100"> | ||
<h2 className={`text-2xl font-extrabold tracking-tight md:max-w-full md:text-3xl ${alignTextClass}`} data-aos="slide-up"> | ||
<span className={`-mb-1 block bg-gradient-to-r pb-1 ${colorClass} relative bg-clip-text text-transparent`}>{children}</span> | ||
</h2> | ||
{subtitle && ( | ||
<h3 | ||
className={`${alignTextClass} tracking-normal md:text-lg ${subtitleColorClass}`} | ||
> | ||
{subtitle} | ||
</h3> | ||
)} | ||
{subtitle && <h3 className={`${alignTextClass} tracking-normal md:text-lg ${subtitleColorClass}`}>{subtitle}</h3>} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AtomTitle; | ||
export default AtomTitle; |
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.