Skip to content

Commit 750ef65

Browse files
authored
Merge pull request #186 from eficode/feature/dashboard-image
feat(app-general): add temporary dashboard image and game name
2 parents 22d50d8 + ee2d04d commit 750ef65

File tree

10 files changed

+109
-70
lines changed

10 files changed

+109
-70
lines changed

packages/game-app/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
</style>
8282
<div id="root"></div>
8383
<div id="initial-loading-overlay">
84-
<img src="eficode-logo.svg">
84+
<img src="/eficode-logo.svg">
8585
</div>
8686
<!--
8787
This HTML file is a template.

packages/game-app/src/assets/icons/dashboard-floating-cards-reference.svg renamed to packages/game-app/src/assets/images/dashboard-floating-cards-reference.svg

+24-23
Loading

packages/game-app/src/dashboard/components/Dashboard/Dashboard.styled.tsx

+38-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import styled from 'styled-components';
2+
import { Box } from '@pipeline/components';
23

34
export const DashboardContainer = styled.div`
45
display: flex;
@@ -15,10 +16,44 @@ export const DashboardHeader = styled.div`
1516
align-items: center;
1617
height: 10vh;
1718
padding: 0 10vw 0 0;
19+
`;
20+
21+
DashboardHeader.displayName = 'DashboardHeader';
22+
23+
export const CardsIllustration = styled(Box)`
1824
position: absolute;
19-
left: 0;
2025
right: 0;
21-
top: 0;
26+
top: 10vh;
27+
bottom: 0;
28+
width: 50vw;
29+
z-index: -1;
30+
background: #eeeeee;
31+
32+
svg {
33+
width: 100%;
34+
height: 100%;
35+
}
2236
`;
2337

24-
DashboardHeader.displayName = 'DashboardHeader';
38+
CardsIllustration.displayName = 'CardsIllustration';
39+
40+
export const DashboardLeftSide = styled(Box)`
41+
max-width: 40vw;
42+
padding-bottom: 10vh;
43+
display: flex;
44+
flex-direction: column;
45+
justify-content: center;
46+
background: white;
47+
`;
48+
49+
DashboardLeftSide.displayName = 'DashboardLeftSide';
50+
51+
export const Triangle = styled(Box)`
52+
width: 0;
53+
height: 0;
54+
border-top: 90vh solid white;
55+
border-right: 15vw solid transparent;
56+
filter: drop-shadow(0px 0px 0px rgba(0, 0, 0, 0.5));
57+
`;
58+
59+
Triangle.displayName = 'Triangle';

packages/game-app/src/dashboard/components/Dashboard/Dashboard.tsx

+25-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ import { useLogout } from '@pipeline/auth';
44
import { RoutingPath, useNavigateTo } from '@pipeline/routing';
55
import { Box, Button, Link, TextLogo, Typography } from '@pipeline/components';
66
import JoinGameButton from '../JoinGameButton';
7-
import { DashboardContainer, DashboardHeader } from './Dashboard.styled';
7+
import {
8+
CardsIllustration,
9+
DashboardContainer,
10+
DashboardHeader,
11+
DashboardLeftSide,
12+
Triangle,
13+
} from './Dashboard.styled';
14+
import { ReactComponent as FloatingCardsImg } from '@assets/images/dashboard-floating-cards-reference.svg';
815

916
type Props = {};
1017

@@ -26,17 +33,23 @@ const Dashboard: React.FC<Props> = () => {
2633
<Button label={t('dashboard.contactUs')} onClick={() => ({})} />
2734
</Box>
2835
</DashboardHeader>
29-
<Box maxWidth="40vw">
30-
<Typography variant="title" fontFamily="Merriweather">
31-
{t('dashboard.title')}
32-
</Typography>
33-
<Typography mt={3} variant="dialogHead" fontWeight="normal">
34-
{t('dashboard.message')}
35-
</Typography>
36-
<Box mt={4} display="flex" flexDirection="row">
37-
<Button id="go-to-create-game-button" onClick={goToCreateGame} label={t('dashboard.newGameLabel')} />
38-
<JoinGameButton />
39-
</Box>
36+
<Box flex={1} display="flex" flexDirection="row">
37+
<DashboardLeftSide>
38+
<Typography variant="title" fontFamily="Merriweather">
39+
{t('dashboard.title')}
40+
</Typography>
41+
<Typography mt={3} variant="dialogHead" fontWeight="normal">
42+
{t('dashboard.message')}
43+
</Typography>
44+
<Box mt={4} display="flex" flexDirection="row">
45+
<Button id="go-to-create-game-button" onClick={goToCreateGame} label={t('dashboard.newGameLabel')} />
46+
<JoinGameButton />
47+
</Box>
48+
</DashboardLeftSide>
49+
<Triangle />
50+
<CardsIllustration flex={1}>
51+
<FloatingCardsImg />
52+
</CardsIllustration>
4053
</Box>
4154
</Box>
4255
</DashboardContainer>

packages/game-app/src/gameView/components/Board/Board.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import React from 'react';
1+
import React, { useContext } from 'react';
22
import { useDroppable } from '@dnd-kit/core';
33
import { BoardContainer } from './Board.styled';
4+
import { ZoomPanValuesContext } from '../ZoomPanContext/ZoomPanContext';
45

5-
type Props = {
6-
scale: number;
7-
};
6+
type Props = {};
87

98
/**
109
* Game board where the pipeline will be created placing the cards.
1110
* It's a droppable area so you can drag the cards in it coming from the panel
1211
* or moving cards inside the board directly
1312
*/
14-
const Board: React.FC<Props> = ({ children, scale }) => {
13+
const Board: React.FC<Props> = ({ children }) => {
1514
const { setNodeRef } = useDroppable({
1615
id: 'board',
1716
});
17+
const { scale } = useContext(ZoomPanValuesContext);
1818

1919
return (
20-
<BoardContainer scale={scale} ref={setNodeRef}>
20+
<BoardContainer id="board" scale={scale} ref={setNodeRef}>
2121
{children}
2222
</BoardContainer>
2323
);

packages/game-app/src/gameView/components/DroppablePanelArea/DroppablePanelArea.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ const ToggleWrapper = styled.div`
5151

5252
export const ArrowIconDiv = styled.div<{ collapsed: boolean }>`
5353
position: absolute;
54-
right: 4px;
54+
right: 16px;
5555
transition: transform 0.3s ease-in;
5656
transform: rotate(180deg);
5757
5858
svg {
59-
width: 36px;
60-
height: 36px;
59+
width: 24px;
60+
height: 24px;
6161
}
6262
6363
${({ collapsed }) =>

packages/game-app/src/gameView/components/GameView/GameView.tsx

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback, useRef, useState } from 'react';
1+
import React, { useRef } from 'react';
22
import CardsGameListeners from '../CardsGameListeners';
33
import Board from '../Board';
44
import DraggableCard from '../DraggableCard';
@@ -39,21 +39,15 @@ const GameView: React.FC<GameProps> = ({ zoomIn, zoomOut }) => {
3939

4040
const panelModeRef = useRef<PanelMode>('stacked');
4141

42-
const [background, setBackGround] = useState(true);
43-
44-
const toggleBackground = useCallback(() => {
45-
setBackGround(s => !s);
46-
}, []);
47-
4842
useStopListenOnRtdb();
4943

5044
return (
5145
<ZoomPanContext initialPan={initialPan}>
5246
<CardsGameListeners panelModeRef={panelModeRef} onEvent={onCardEvent} currentGameState={state}>
5347
<div className="board-wrapper">
54-
<TopWidgetsRow toggleBackGround={toggleBackground} />
48+
<TopWidgetsRow />
5549
<ZoomPanContainer>
56-
<Board scale={background ? 3 : -1}>
50+
<Board>
5751
{placedCardsIds.map(id => (
5852
<DraggableCard key={id} id={id} />
5953
))}

0 commit comments

Comments
 (0)