-
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 #73 from Quest-Finder/develop
Alterações fix/pageContent
- Loading branch information
Showing
23 changed files
with
188 additions
and
204 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
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
14 changes: 10 additions & 4 deletions
14
src/features/page-profile/introduction/components/UserSectionTitle.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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
import { cva } from 'class-variance-authority' | ||
import { cn } from '@/lib/utils' | ||
|
||
interface UserSectionTitleProps | ||
extends React.HtmlHTMLAttributes<HTMLHeadingElement> { | ||
title: string | ||
} | ||
|
||
const Title = cva('text-2xl text-neutral-950 h-10 leading-[3rem] sm:h-8 w-full') | ||
|
||
export function UserSectionTitle({ title, className }: UserSectionTitleProps) { | ||
return <h2 className={cn(Title({ className }))}>{title}</h2> | ||
return ( | ||
<h2 | ||
className={cn( | ||
'w-full font-notoSans text-2xl font-semibold leading-10 text-neutral-950 md:leading-8', | ||
className, | ||
)} | ||
> | ||
{title} | ||
</h2> | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
src/features/page-profile/introduction/helpers/resizeDelay.ts
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,12 @@ | ||
export const resizeDelay = (func: () => void, milliseconds?: number) => { | ||
const time = milliseconds || 400 | ||
let timer: number | ||
|
||
return (event: Event): void => { | ||
if (timer) { | ||
clearTimeout(timer) | ||
} | ||
|
||
timer = setTimeout(func, time, event) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/features/page-profile/introduction/hooks/useResize.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,20 @@ | ||
import { useState, useEffect } from 'react' | ||
import { resizeDelay } from '../helpers/resizeDelay' | ||
|
||
export function useResize() { | ||
const [size, setSize] = useState([window.innerWidth, window.innerHeight]) | ||
|
||
useEffect(() => { | ||
const resize = resizeDelay(() => { | ||
setSize([window.innerWidth, window.innerHeight]) | ||
}) | ||
|
||
window.addEventListener('resize', resize) | ||
|
||
return () => { | ||
window.removeEventListener('resize', resize) | ||
} | ||
}, []) | ||
|
||
return { width: size[0], height: size[1] } | ||
} |
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
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.