-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: can hover filter trigger * refactor * log仕込み * fix: iroiro * feat: 幅320pxに対応 * fix: mobile streamer icon size * feat: sticky date header * refactor: iroiro
- Loading branch information
Showing
21 changed files
with
277 additions
and
97 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,16 @@ | ||
import React from "react"; | ||
import { Button } from "./styles"; | ||
import { useSettingInterface } from "src/hooks"; | ||
|
||
export const DisplayHistoryButton = () => { | ||
const { isDisplayHistory } = useSettingInterface(); | ||
|
||
return ( | ||
<Button | ||
state={isDisplayHistory.state} | ||
onClick={() => isDisplayHistory.onChange(!isDisplayHistory.state)} | ||
> | ||
<isDisplayHistory.icon size={24} /> | ||
</Button> | ||
); | ||
}; |
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,24 @@ | ||
import styled, { css } from "styled-components"; | ||
|
||
export const Button = styled.button<{ state: boolean }>` | ||
width: 40px; | ||
border: 0; | ||
border-radius: 5px; | ||
background-color: ${({ theme }) => theme.displayHistoryButton.bg.normal}; | ||
transition: 0.3s ease; | ||
color: ${({ theme, state }) => | ||
state | ||
? theme.displayHistoryButton.iconActive | ||
: theme.displayHistoryButton.icon}; | ||
${({ state }) => | ||
state && | ||
css` | ||
box-shadow: | ||
inset 3px 3px 5px #bbbbbb, | ||
inset -3px -3px 5px #ffffff; | ||
`} | ||
&:hover { | ||
background-color: ${({ theme }) => theme.displayHistoryButton.bg.hover}; | ||
} | ||
`; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, { | ||
ReactElement, | ||
ReactNode, | ||
useEffect, | ||
useRef, | ||
useState, | ||
} from "react"; | ||
import { ObserverElement } from "./styles"; | ||
|
||
type Props<T> = { | ||
data: T[]; | ||
renderItem: (props: T) => ReactNode; | ||
observerHeight?: number; | ||
}; | ||
|
||
export const InViewContainer = <T,>({ | ||
data, | ||
renderItem, | ||
observerHeight, | ||
}: Props<T>): ReactElement => { | ||
const [renderDataIdx, setRenderDataIdx] = useState<number>(1); | ||
const ref = useRef<HTMLDivElement>(null!); | ||
|
||
useEffect(() => { | ||
const observer = new IntersectionObserver(([entry]) => { | ||
if (!entry.isIntersecting) return; | ||
|
||
setRenderDataIdx((n) => ++n); | ||
}); | ||
|
||
observer.observe(ref.current); | ||
|
||
return () => { | ||
observer.unobserve(ref.current); | ||
setRenderDataIdx(1); | ||
}; | ||
}, [data]); | ||
|
||
return ( | ||
<> | ||
{data.slice(0, renderDataIdx).map((props) => renderItem(props))} | ||
<ObserverElement ref={ref} height={observerHeight} /> | ||
</> | ||
); | ||
}; |
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,6 @@ | ||
import styled from "styled-components"; | ||
|
||
export const ObserverElement = styled.div<{ height?: number }>` | ||
min-height: ${({ height }) => height ?? 0}px; | ||
width: 100%; | ||
`; |
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
Oops, something went wrong.