-
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.
- Loading branch information
1 parent
95c9fc1
commit 30fa756
Showing
24 changed files
with
725 additions
and
61 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,13 @@ | ||
"use client"; | ||
|
||
import { useState } from "react"; | ||
|
||
export const Counter = () => { | ||
|
||
const [count, setCount] = useState(0); | ||
|
||
console.log('Counter component - '); | ||
return ( | ||
<button onClick={() => setCount(count + 1)}>Count: {count}</button> | ||
) | ||
} |
Empty file.
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,35 @@ | ||
"use client"; | ||
import Link from "next/link"; | ||
import { usePathname } from "next/navigation"; | ||
|
||
export const Navigation = () => { | ||
const pathname = usePathname(); | ||
return ( | ||
<nav className="flex justify-center items-center p-4"> | ||
<Link | ||
href="/" | ||
className={pathname === "/" ? "font-bold mr-4" : "text-blue-500 mr-4"} | ||
> | ||
Home | ||
</Link> | ||
<Link | ||
href="/about" | ||
className={ | ||
pathname === "/about" ? "font-bold mr-4" : "text-blue-500 mr-4" | ||
} | ||
> | ||
About | ||
</Link> | ||
<Link | ||
href="/products/1" | ||
className={ | ||
pathname.startsWith("/products/1") | ||
? "font-bold mr-4" | ||
: "text-blue-500 mr-4" | ||
} | ||
> | ||
Product 1 | ||
</Link> | ||
</nav> | ||
); | ||
}; |
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,15 @@ | ||
"use client"; | ||
|
||
import { useState } from "react"; | ||
|
||
export const D = () => { | ||
|
||
const [count, setCount] = useState(0); | ||
|
||
console.log('Counter component - '); | ||
return ( | ||
<button onClick={() => setCount(count + 1)}> Count: {count} </button> | ||
) | ||
} | ||
|
||
export default D; |
This file was deleted.
Oops, something went wrong.
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
8 changes: 8 additions & 0 deletions
8
frontend/src/components/atoms/ColorBlock/ColorBlock.module.css
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,8 @@ | ||
.dark-block { | ||
--default-text: var(--common-light-100); | ||
--default-components-link-fg: #f8f6f7; | ||
--hover-text: var(--common-light-100); | ||
--hover-components-link-fg: #f8f6f7; | ||
--active-text-ondark: var(--common-light-100); | ||
--active-components-link-fg: #f8f6f7; | ||
} |
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,26 @@ | ||
import React, { createContext, useContext, ReactNode, } from 'react'; | ||
import classNames from 'classnames'; | ||
import styles from './ColorBlock.module.css'; | ||
|
||
type BlockColor = 'light' | 'dark'; | ||
|
||
const BlockColorContext = createContext<BlockColor>('light'); | ||
|
||
interface BlockColorProviderProps { | ||
children: ReactNode; | ||
blockColor: BlockColor; | ||
} | ||
|
||
export const BlockColorProvider: React.FC<BlockColorProviderProps> = ({ children, blockColor }) => { | ||
return ( | ||
<BlockColorContext.Provider | ||
value={blockColor} | ||
> | ||
<div | ||
className={classNames({ [styles["dark-block"]]: blockColor === 'dark' })} | ||
> | ||
{children} | ||
</div> | ||
</BlockColorContext.Provider> | ||
); | ||
}; |
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,35 @@ | ||
/* default link styles[on light] */ | ||
.link { | ||
color: var(--default-components-link-fg); | ||
text-decoration: underline; | ||
cursor: pointer; | ||
font-family: var(--font-raleway-regular); | ||
} | ||
|
||
|
||
.link { | ||
display: inline-block; | ||
position: relative; | ||
text-decoration: none; | ||
transition: color 0.3s ease; | ||
} | ||
|
||
/* Effect one: Underline - Inside Out */ | ||
.link::before { | ||
content: ""; | ||
position: absolute; | ||
width: 100%; | ||
height: 1px; | ||
bottom: -1px; | ||
left: 0; | ||
opacity: 0.33; | ||
background-color: var(--default-components-link-fg); | ||
transition: width 0.3s ease, left 0.3s ease; | ||
} | ||
|
||
.link:hover::before { | ||
width: 100%; | ||
left: 0; | ||
opacity: 1; | ||
background-color: var(--default-components-link-fg); | ||
} |
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 React, { FC, PropsWithChildren } from 'react'; | ||
import NextLink from 'next/link'; | ||
import classNames from "classnames"; | ||
|
||
import styles from "./Link.module.css"; | ||
|
||
type LinkProps = | ||
| { | ||
to: string; | ||
href?: never; | ||
target?: string; | ||
} | ||
| { | ||
to?: never; | ||
href: string; | ||
target?: string; | ||
}; | ||
|
||
const Link: FC<PropsWithChildren<LinkProps> & { onDark?: true }> = ({ | ||
to, | ||
href, | ||
target, | ||
children, | ||
}) => { | ||
const classes = classNames( | ||
styles.link, | ||
); | ||
|
||
if (to) { | ||
// Internal link using next/link | ||
return ( | ||
<NextLink href={to} target={target || "_self"} className={classes}> | ||
<span>{children}</span> | ||
</NextLink> | ||
); | ||
} | ||
|
||
if (href) { | ||
// External link | ||
return ( | ||
<a href={href} target={target || "_blank"} className={styles.link}> | ||
<span>{children}</span> | ||
</a> | ||
); | ||
} | ||
}; | ||
|
||
export default Link; |
Oops, something went wrong.