generated from 2skydev/electron-vite-react-ts-template
-
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
Showing
19 changed files
with
227 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface AutoAcceptData { | ||
timer?: number; | ||
playerResponse: string; | ||
autoAcceptDelaySeconds?: number; | ||
} |
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
Binary file not shown.
Binary file not shown.
39 changes: 39 additions & 0 deletions
39
src/features/overlay/ReadyTimerOverlay/ReadyTimerOverlay.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,39 @@ | ||
import { useEffect, useState } from 'react'; | ||
|
||
import clsx from 'clsx'; | ||
|
||
import { AutoAcceptData } from '@app/types'; | ||
|
||
import { ReadyTimerOverlayStyled } from './styled'; | ||
|
||
export interface ReadyTimerOverlayProps { | ||
className?: string; | ||
} | ||
|
||
const ReadyTimerOverlay = ({ className }: ReadyTimerOverlayProps) => { | ||
const [data, setData] = useState<AutoAcceptData | null>(null); | ||
|
||
useEffect(() => { | ||
window.electron.subscribeLeague('league/auto-accept', (data: AutoAcceptData) => { | ||
if (data.playerResponse === 'None') { | ||
setData(data); | ||
} else { | ||
setData(null); | ||
} | ||
}); | ||
|
||
return () => { | ||
window.electron.unsubscribeLeague('league/auto-accept'); | ||
}; | ||
}, []); | ||
|
||
if (!data) return null; | ||
|
||
return ( | ||
<ReadyTimerOverlayStyled className={clsx('ReadyTimerOverlay', className)}> | ||
자동 수락까지 {data.autoAcceptDelaySeconds! - data.timer!}초 남았습니다 | ||
</ReadyTimerOverlayStyled> | ||
); | ||
}; | ||
|
||
export default ReadyTimerOverlay; |
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 @@ | ||
// === Automatically generated file. Don't edit it. === | ||
export * from './ReadyTimerOverlay'; | ||
export { default } from './ReadyTimerOverlay'; |
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,11 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const ReadyTimerOverlayStyled = styled.div` | ||
position: absolute; | ||
top: calc(50% + 100px); | ||
left: calc(50%); | ||
transform: translate(-50%, -50%); | ||
color: ${props => props.theme.colors.gold}; | ||
text-align: center; | ||
font-family: 'BeaufortforLOL'; | ||
`; |
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,12 @@ | ||
import ReadyTimerOverlay from '~/features/overlay/ReadyTimerOverlay'; | ||
import { OverlaysClientPageStyled } from '~/styles/pageStyled/overlaysClientPageStyled'; | ||
|
||
const OverlaysClient = () => { | ||
return ( | ||
<OverlaysClientPageStyled> | ||
<ReadyTimerOverlay /> | ||
</OverlaysClientPageStyled> | ||
); | ||
}; | ||
|
||
export default OverlaysClient; |
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,7 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const OverlaysClientPageStyled = styled.div` | ||
width: 100vw; | ||
height: 100vh; | ||
position: relative; | ||
`; |
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,5 +1,27 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const SettingsPageStyled = styled.div` | ||
.autoAcceptField { | ||
display: inline-flex; | ||
align-items: center; | ||
.delay { | ||
display: flex; | ||
align-items: center; | ||
background: ${props => props.theme.colors.formFieldBG}; | ||
padding: 0.6rem 1rem; | ||
border-radius: 8px; | ||
margin-left: 1rem; | ||
transition: 250ms opacity; | ||
&.disabled { | ||
opacity: 0.5; | ||
} | ||
.ant-input-number { | ||
width: 3.5rem; | ||
margin: 0 0.5rem; | ||
} | ||
} | ||
} | ||
`; |
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.