-
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.
Merge pull request #250 from SaekKkanDa/develop
베포: google adsense 심사용 배포
- Loading branch information
Showing
36 changed files
with
609 additions
and
197 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,33 @@ | ||
import { CSSProperties, ReactNode } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
export interface HiddenProps { | ||
isHidden: boolean; | ||
isUseVisibility?: boolean; | ||
style?: CSSProperties; | ||
children?: ReactNode; | ||
} | ||
export function Hidden({ | ||
isHidden, | ||
isUseVisibility = false, | ||
style, | ||
children, | ||
}: HiddenProps) { | ||
return ( | ||
<HiddenContainer | ||
isHidden={isHidden} | ||
isUseVisibility={isUseVisibility} | ||
style={style} | ||
> | ||
{children} | ||
</HiddenContainer> | ||
); | ||
} | ||
|
||
const HiddenContainer = styled.div<{ | ||
isHidden: boolean; | ||
isUseVisibility: boolean; | ||
}>` | ||
${({ isUseVisibility, isHidden }) => | ||
isHidden && (isUseVisibility ? 'visiblity : hidden' : 'display : none')} | ||
`; |
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,47 @@ | ||
import { ReactElement, ReactNode, cloneElement } from 'react'; | ||
import { createPortal } from 'react-dom'; | ||
import styled from 'styled-components'; | ||
|
||
import { Hidden } from '@Base/components/Hidden'; | ||
|
||
export interface ModalBaseProps { | ||
backdropComponent?: ReactElement; | ||
children?: ReactNode; | ||
isOpen: boolean; | ||
onClose?: () => void; | ||
} | ||
|
||
export function ModalBase({ | ||
backdropComponent = <DefaultBackdrop />, | ||
children, | ||
isOpen, | ||
onClose, | ||
}: ModalBaseProps) { | ||
return createPortal( | ||
<Hidden isHidden={!isOpen}> | ||
<Container> | ||
{cloneElement(backdropComponent, { onClick: onClose })} | ||
{children} | ||
</Container> | ||
</Hidden>, | ||
document.body | ||
); | ||
} | ||
|
||
export const Container = styled.div` | ||
position: relative; | ||
height: 100%; | ||
max-height: 100dvh; | ||
overflow: hidden; | ||
`; | ||
|
||
export const DefaultBackdrop = styled.div` | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: #27272a; | ||
opacity: 0.5; | ||
z-index: 10; | ||
`; |
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,28 @@ | ||
import { useCallback, useState } from 'react'; | ||
|
||
import { isTrue } from '@Base/utils/check'; | ||
|
||
export interface UseModalProps { | ||
defaultMessage?: string; | ||
defaultIsOpen?: boolean; | ||
} | ||
|
||
export function useModal({ | ||
defaultIsOpen = false, | ||
defaultMessage = '', | ||
}: UseModalProps) { | ||
const [isOpen, setIsOpen] = useState(defaultIsOpen); | ||
const [message, setMessage] = useState(defaultMessage); | ||
|
||
const open = useCallback((message?: string) => { | ||
if (isTrue(message)) setMessage(message); | ||
|
||
setIsOpen(true); | ||
}, []); | ||
|
||
const close = useCallback(() => { | ||
setIsOpen(false); | ||
}, []); | ||
|
||
return { isOpen, message, open, close }; | ||
} |
File renamed without changes.
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,31 @@ | ||
import { useCallback, useEffect, useState } from 'react'; | ||
|
||
import { isFalse } from '@Base/utils/check'; | ||
|
||
export interface UseTriggerProps { | ||
triggerFn?: () => boolean; | ||
onTrigger?: (reset: () => void) => void; | ||
} | ||
|
||
export function useTrigger({ triggerFn, onTrigger }: UseTriggerProps) { | ||
const [isTriggered, setIsTriggered] = useState(false); | ||
|
||
const reset = useCallback(() => { | ||
setIsTriggered(false); | ||
}, []); | ||
|
||
const trigger = useCallback(() => { | ||
setIsTriggered(true); | ||
}, []); | ||
|
||
useEffect(() => { | ||
if (isFalse(triggerFn)) return; | ||
|
||
if (triggerFn()) { | ||
setIsTriggered(true); | ||
onTrigger?.(reset); | ||
} | ||
}, [onTrigger, reset, triggerFn]); | ||
|
||
return { isTriggered, reset, trigger }; | ||
} |
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,3 @@ | ||
export function createConsecutiveNumbers(length: number, startNum = 0) { | ||
return new Array(length).fill(0).map((_, idx) => startNum + idx); | ||
} |
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,22 @@ | ||
/** | ||
* checking object if is null + undefined or not | ||
* if object is 0, this functions consider as true | ||
*/ | ||
export function isFalse<T>(obj: T | undefined | null): obj is undefined | null { | ||
if (obj === undefined || obj === null) return true; | ||
|
||
return false; | ||
} | ||
|
||
/** | ||
* checking object if is null + undefined or not | ||
* if object is 0, this functions consider as true | ||
*/ | ||
export function isTrue<T>(obj: T | undefined | null): obj is T { | ||
return !isFalse(obj); | ||
} | ||
|
||
export function isEmpty<T extends string | Array<unknown>>(obj: T) { | ||
if (obj.length === 0) return true; | ||
return false; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Sitemap: https://omct.web.app/sitemap.xml |
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,87 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset | ||
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 | ||
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> | ||
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com --> | ||
|
||
|
||
<url> | ||
<loc>https://omct.web.app/</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>1.00</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/all-types-view</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=springbright</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=springwarm</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=springlight</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=summerlight</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=summercool</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=summermute</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=autumnmute</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=autumnwarm</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=autumndeep</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=winterdeep</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=wintercool</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/result?colorType=winterbright</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.80</priority> | ||
</url> | ||
<url> | ||
<loc>https://omct.web.app/image-upload</loc> | ||
<lastmod>2023-11-05T00:28:50+00:00</lastmod> | ||
<priority>0.20</priority> | ||
</url> | ||
|
||
|
||
</urlset> |
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,28 @@ | ||
import { useEffect } from 'react'; | ||
|
||
declare global { | ||
interface Window { | ||
adsbygoogle: unknown[]; | ||
} | ||
} | ||
|
||
export interface AdSenseProps { | ||
'data-ad-slot': string; | ||
} | ||
|
||
export function AdSense(props: AdSenseProps) { | ||
useEffect(() => { | ||
(window.adsbygoogle = window.adsbygoogle || []).push({}); | ||
}, []); | ||
|
||
return ( | ||
<ins | ||
className="adsbygoogle" | ||
style={{ display: 'block' }} | ||
data-ad-client="ca-pub-9551977219354865" | ||
data-ad-format="auto" | ||
data-full-width-responsive="true" | ||
{...props} | ||
/> | ||
); | ||
} |
Oops, something went wrong.