Skip to content

Commit

Permalink
fix: ts 에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
gominzip committed Nov 12, 2024
1 parent 93a4e39 commit 80d88fa
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 22 deletions.
4 changes: 3 additions & 1 deletion frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ dist-ssr

.vite

.dist
.dist

tsconfig.tsbuildinfo
38 changes: 21 additions & 17 deletions frontend/src/components/client/Player.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
import styled from 'styled-components';
import { useState } from 'react';

import playerLoading from '@assets/player_loading.gif';
import PlayIcon from '@assets/play_icon.svg';

interface ContainerProps {
onStreaming: boolean;
}

const Player = () => {
const [onStreaming, setOnStreaming] = useState(false);

return (
<Container $onStreaming={onStreaming}>
<LivePlayerInner>{!onStreaming && <PlayButton onClick={() => setOnStreaming(true)} />}</LivePlayerInner>
<LivePlayerInner>
{!onStreaming && (
<PlayButton onClick={() => setOnStreaming(true)}>
<PlayIcon />
</PlayButton>
)}
</LivePlayerInner>
</Container>
);
};

export default Player;

const Container = styled.div<ContainerProps>`
background: ${({ onStreaming, theme }) =>
onStreaming ? theme.tokenColors['surface-default'] : `url(${playerLoading}) no-repeat center / cover`};
const Container = styled.div<{ $onStreaming: boolean }>`
background: ${({ $onStreaming, theme }) =>
$onStreaming ? theme.tokenColors['surface-default'] : `url(${playerLoading}) no-repeat center / cover`};
padding-top: 56.25%;
position: relative;
`;

const LivePlayerInner = styled.div`
position: absolute;
left: 0;
Expand All @@ -38,13 +34,21 @@ const LivePlayerInner = styled.div`
align-items: center;
justify-content: center;
`;

const PlayButton = styled(PlayIcon)`
const PlayButton = styled.button`
width: 55px;
height: 55px;
background: none;
border: none;
padding: 0;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
&:active {
opacity: 0.8;
}
svg {
width: 100%;
height: 100%;
}
`;
2 changes: 1 addition & 1 deletion frontend/src/styles/theme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TypographyToken, ColorToken } from '@types/style';
import { TypographyToken, ColorToken } from '@type/style';

export const colorMap = {
gray: {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/types/style.ts → frontend/src/type/style.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type colorToken =
export type ColorToken =
| 'surface-default'
| 'surface-alt'
| 'text-weak'
Expand All @@ -12,7 +12,7 @@ export type colorToken =
| 'red-default'
| 'border-default';

export type typographyToken =
export type TypographyToken =
| 'display-bold48'
| 'display-bold24'
| 'display-bold20'
Expand Down
2 changes: 1 addition & 1 deletion frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@pages/*": ["src/pages/*"],
"@assets/*": ["src/assets/*"],
"@styles/*": ["src/styles/*"],
"@types/*": ["src/types/*"]
"@type/*": ["src/type/*"]
},
"types": ["vite/client"]
},
Expand Down

0 comments on commit 80d88fa

Please sign in to comment.