Skip to content

Commit

Permalink
Merge pull request #45 from chiachun2491/feature/enhancement
Browse files Browse the repository at this point in the history
feat(frontend): enhancement
  • Loading branch information
chiachunho authored May 28, 2021
2 parents 9bb3dd1 + 6d8a654 commit 251b9fd
Show file tree
Hide file tree
Showing 39 changed files with 861 additions and 923 deletions.
4 changes: 2 additions & 2 deletions mysite/frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="2021 NTNU OOAD Project"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
Expand All @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>矮人礦坑</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
32 changes: 0 additions & 32 deletions mysite/frontend/src/App.js

This file was deleted.

8 changes: 0 additions & 8 deletions mysite/frontend/src/App.test.js

This file was deleted.

File renamed without changes.
96 changes: 0 additions & 96 deletions mysite/frontend/src/components/GameEnd.js

This file was deleted.

30 changes: 0 additions & 30 deletions mysite/frontend/src/components/GameRoomError.js

This file was deleted.

30 changes: 0 additions & 30 deletions mysite/frontend/src/components/GameRoomNotFound.js

This file was deleted.

48 changes: 0 additions & 48 deletions mysite/frontend/src/components/Hello.js

This file was deleted.

9 changes: 9 additions & 0 deletions mysite/frontend/src/components/Loading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Spinner } from 'react-bootstrap';

const Loading = () => (
<div className='d-flex align-items-center justify-content-center'>
<Spinner animation='border' variant='brown' size={'sm'} className={'mr-2'} /> 載入中...
</div>
);

export { Loading };
2 changes: 1 addition & 1 deletion mysite/frontend/src/components/Logout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axiosInstance from '../Api';
import axiosInstance from '../api/Api';

function handleLogout() {
try {
Expand Down
30 changes: 0 additions & 30 deletions mysite/frontend/src/components/PageNotFound.js

This file was deleted.

File renamed without changes.
18 changes: 8 additions & 10 deletions mysite/frontend/src/components/TutorialOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ function TutorialPopover(title = null, content = null, button = null, handleEven
);
}

function TutorialOverlayTrigger(props) {
return (
<OverlayTrigger
placement={props.placement ? props.placement : 'top'}
overlay={props.overlay}
show={props.show ? props.show : false}>
{props.children}
</OverlayTrigger>
);
}
const TutorialOverlayTrigger = (props) => (
<OverlayTrigger
placement={props.placement ? props.placement : 'top'}
overlay={props.overlay}
show={props.show ? props.show : false}>
{props.children}
</OverlayTrigger>
);

export { TutorialPopover, TutorialOverlayTrigger };
28 changes: 28 additions & 0 deletions mysite/frontend/src/components/errors/GameRoomError.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import { Row, Col, Button } from 'react-bootstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faDoorOpen, faUsersSlash } from '@fortawesome/free-solid-svg-icons';
import { Helmet } from 'react-helmet';

const GameRoomError = () => (
<>
<Helmet>
<title>{'500:房間壞掉了!'}</title>
</Helmet>
<Row className={'d-flex align-items-center'}>
<Col xs={'12'} md={'6'} className={'p-5 d-flex justify-content-center'}>
<FontAwesomeIcon icon={faUsersSlash} className={'icon-fluid tool'} />
</Col>
<Col xs={'12'} md={'6'} className={'p-5'}>
<h1>500</h1>
<h3>房間壞掉了!</h3>
<p>你現在進入的房間發生了問題,試著重新整理或是按下方按鈕可以導引你回到遊戲大廳開始新遊戲。</p>
<Button variant={'brown'} href={'/games/'}>
<FontAwesomeIcon icon={faDoorOpen} /> 回到大廳
</Button>
</Col>
</Row>
</>
);

export default GameRoomError;
28 changes: 28 additions & 0 deletions mysite/frontend/src/components/errors/GameRoomNotFound.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import { Row, Col, Button } from 'react-bootstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faDoorOpen, faUsersSlash } from '@fortawesome/free-solid-svg-icons';
import { Helmet } from 'react-helmet';

const GameRoomNotFound = () => (
<>
<Helmet>
<title>{'404:你走錯房間囉!'}</title>
</Helmet>
<Row className={'d-flex align-items-center'}>
<Col xs={'12'} md={'6'} className={'p-5 d-flex justify-content-center'}>
<FontAwesomeIcon icon={faUsersSlash} className={'icon-fluid tool'} />
</Col>
<Col xs={'12'} md={'6'} className={'p-5'}>
<h1>404</h1>
<h3>你走錯房間囉!</h3>
<p>你現在進入的房間並不存在,按下方按鈕可以導引你回到遊戲大廳。</p>
<Button variant={'brown'} href={'/games/'}>
<FontAwesomeIcon icon={faDoorOpen} /> 回到大廳
</Button>
</Col>
</Row>
</>
);

export default GameRoomNotFound;
Loading

0 comments on commit 251b9fd

Please sign in to comment.