Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: 버그 수정 #723

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { SerializedStyles, css } from '@emotion/react';
export const name = ({ font }: { font: string | SerializedStyles }) => css`
${font}
overflow-x: hidden;

max-width: 40vw;

color: black;
text-overflow: ellipsis;
white-space: nowrap;
`;
17 changes: 9 additions & 8 deletions frontend/src/components/Icons/SolidArrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ export default function SolidArrow(props: SolidArrowProps) {
viewBox="0 0 27 27"
fill="none"
xmlns="http://www.w3.org/2000/svg"
transform={`rotate(${directionMapper[direction]})`}
{...otherProps}
>
<path
d="M16.8446 23.5825L6.73785 12.8812L16.8446 3.36893"
stroke={color || '#767676'}
strokeWidth="2.24595"
strokeLinecap="round"
strokeLinejoin="round"
/>
<g transform={`rotate(${directionMapper[direction]} 13.5 13.5)`}>
<path
d="M16.8446 23.5825L6.73785 12.8812L16.8446 3.36893"
stroke={color || '#767676'}
strokeWidth="2.24595"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>
</svg>
);
}
1 change: 1 addition & 0 deletions frontend/src/components/OptionsPanel/OptionsPanel.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const panel = ({

width: ${width};

background-color: white;
border: 0;
border-radius: 2.4rem;
box-shadow: 0 0 12.6px 0 rgb(178 178 178 / 33%);
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/Bet/BetDetailPage/BetDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const getButtonMessage = (bet?: BetDetail) => {

const getIsButtonDisabled = (bet?: BetDetail) => {
if (!bet) return true;
if (bet.isAnnounced && bet.chatroomId) return false;
if (bet.isAnnounced && bet.chatroomId) return true;
if (bet.myRole === 'MOIMER') return false;

if (bet.myRole === 'MOIMEE') return true;
if (bet.myRole === 'NON_MOIMEE') return true;
return false;
if (bet.myRole === 'NON_MOIMEE') return false;
return true;
};

const bitbit = 'bitbit';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Bet/BetResultPage/BetResultPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function BetResultPage() {
/>
)}
</RouletteWrapper>
{isButtonShown && (
{isButtonShown && bet?.myRole !== 'NON_MOIMEE' && (
<Button
shape="bar"
primary
Expand Down
16 changes: 12 additions & 4 deletions frontend/src/pages/Bet/components/Roulette/DrawRoulette.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const getCanvasUtil = (canvas: HTMLCanvasElement) => {
const getCanvasUtil = (
canvas: HTMLCanvasElement,
widthPx?: number,
heightPx?: number,
) => {
return {
/**
* getPercentToWidth
Expand All @@ -8,7 +12,7 @@ const getCanvasUtil = (canvas: HTMLCanvasElement) => {
*/

gpw: (percent: number) => {
const width = canvas.width;
const width = widthPx ?? canvas.width;
percent = Math.min(percent, width);

return (percent / 100) * width;
Expand All @@ -21,7 +25,7 @@ const getCanvasUtil = (canvas: HTMLCanvasElement) => {
* @returns percentNumber
*/
gph: (percent: number) => {
const height = canvas.height;
const height = heightPx ?? canvas.height;
percent = Math.min(percent, height);

return (percent / 100) * height;
Expand Down Expand Up @@ -274,6 +278,8 @@ interface drawRouletteProps {
stopSpeed?: number;
fontColor?: string;
itemPercent?: number;
widthPx?: number;
heightPx?: number;
onEnd?: () => void;
}

Expand All @@ -289,12 +295,14 @@ export default function drawRoulette(props: drawRouletteProps) {
stopSpeed = 3,
fontColor = 'grey',
itemPercent = 100,
widthPx,
heightPx,
onEnd,
} = props;
const ctx = canvas.getContext('2d');
if (!ctx) return { clearCanvas: () => {} };

const { gpw, gph } = getCanvasUtil(canvas);
const { gpw, gph } = getCanvasUtil(canvas, widthPx, heightPx);

const FRAME_SECOND = 20;
const slotItemMover = new SlotItemMover(
Expand Down
12 changes: 9 additions & 3 deletions frontend/src/pages/Bet/components/Roulette/Roulette.styles.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { css } from '@emotion/react';

export const canvas = css`
width: 25rem;
height: 13rem;
export const canvas = ({
width,
height,
}: {
width: number;
height: number;
}) => css`
width: ${width}px;
height: ${height}px;
border-radius: 8px;
`;
17 changes: 16 additions & 1 deletion frontend/src/pages/Bet/components/Roulette/Roulette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ interface RouletteProps extends HTMLAttributes<HTMLCanvasElement> {
stopSpeed?: number;
fontColor?: string;
itemPercent?: number;
widthPx?: number;
heightPx?: number;
onEnd?: () => void;
}

Expand All @@ -29,7 +31,10 @@ export default function Roulette(props: RouletteProps) {
fontSize = 32,
stopSpeed = 3,
fontColor = '#6D717F',
widthPx = 250,
heightPx = 130,
itemPercent = 100,

onEnd,
...otherProps
} = props;
Expand All @@ -50,6 +55,8 @@ export default function Roulette(props: RouletteProps) {
stopSpeed,
fontColor,
itemPercent,
widthPx,
heightPx,
onEnd: () => {
onEnd && onEnd();
isEnded.current = true;
Expand All @@ -68,8 +75,16 @@ export default function Roulette(props: RouletteProps) {
stopSpeed,
fontColor,
itemPercent,
widthPx,
heightPx,
onEnd,
]);

return <canvas ref={canvasRef} css={S.canvas} {...otherProps} />;
return (
<canvas
ref={canvasRef}
css={S.canvas({ width: widthPx, height: heightPx })}
{...otherProps}
/>
);
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import LoginLayout from '@_layouts/LoginLayout/LoginLayout';
import MissingFallback from '@_components/Fallback/MissingFallback/MissingFallback';
import * as S from './OAuthMigrationResultPage.style';
import { useTheme } from '@emotion/react';

import { useNavigate, useParams } from 'react-router-dom';

import Button from '@_components/Button/Button';
import GET_ROUTES from '@_common/getRoutes';
import HappyFallback from '@_components/Fallback/HappyFallback/HappyFallback';
import LoginLayout from '@_layouts/LoginLayout/LoginLayout';
import MissingFallback from '@_components/Fallback/MissingFallback/MissingFallback';
import ROUTES from '@_constants/routes';
import { getInviteCode } from '@_common/inviteCodeManager';
import { useEffect } from 'react';
import GET_ROUTES from '@_common/getRoutes';
import HappyFallback from '@_components/Fallback/HappyFallback/HappyFallback';
import { useTheme } from '@emotion/react';

export default function OAuthMigrationResultPage() {
const theme = useTheme();
Expand Down Expand Up @@ -75,9 +76,9 @@ export default function OAuthMigrationResultPage() {
<LoginLayout.Footer>
<Button
shape={'bar'}
onClick={() => navigate(GET_ROUTES.default.home)}
onClick={() => navigate(ROUTES.darakbangSelectOption)}
>
로그인 페이지로 이동하기
다락방 선택 페이지로 이동하기
</Button>
</LoginLayout.Footer>
</LoginLayout>
Expand Down
Loading