Skip to content

Commit d47ff8e

Browse files
CaptainIRSElzaCS
andauthored
Minor UI fixes (#87)
* Minor UI fixes * Fix contacts table alignment * Hack to fix leaderboard column width * Update src/app/components/ReactTour.tsx (Review) Co-authored-by: Anu John <[email protected]> * Update src/app/components/ReactTour.tsx (Review) Co-authored-by: Anu John <[email protected]> * Fix story modal title Co-authored-by: Anu John <[email protected]>
1 parent 6418513 commit d47ff8e

File tree

13 files changed

+73
-41
lines changed

13 files changed

+73
-41
lines changed

__tests__/app/containers/__snapshots__/SideBar.test.tsx.snap

+12-12
Original file line numberDiff line numberDiff line change
@@ -1002,13 +1002,13 @@ exports[`SideBar Container Should render 1`] = `
10021002
icon={
10031003
Object {
10041004
"icon": Array [
1005-
512,
1005+
576,
10061006
512,
10071007
Array [],
1008-
"f05a",
1009-
"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z",
1008+
"f015",
1009+
"M488 312.7V456c0 13.3-10.7 24-24 24H348c-6.6 0-12-5.4-12-12V356c0-6.6-5.4-12-12-12h-72c-6.6 0-12 5.4-12 12v112c0 6.6-5.4 12-12 12H112c-13.3 0-24-10.7-24-24V312.7c0-3.6 1.6-7 4.4-9.3l188-154.8c4.4-3.6 10.8-3.6 15.3 0l188 154.8c2.7 2.3 4.3 5.7 4.3 9.3zm83.6-60.9L488 182.9V44.4c0-6.6-5.4-12-12-12h-56c-6.6 0-12 5.4-12 12V117l-89.5-73.7c-17.7-14.6-43.3-14.6-61 0L4.4 251.8c-5.1 4.2-5.8 11.8-1.6 16.9l25.5 31c4.2 5.1 11.8 5.8 16.9 1.6l235.2-193.7c4.4-3.6 10.8-3.6 15.3 0l235.2 193.7c5.1 4.2 12.7 3.5 16.9-1.6l25.5-31c4.2-5.2 3.4-12.7-1.7-16.9z",
10101010
],
1011-
"iconName": "info-circle",
1011+
"iconName": "home",
10121012
"prefix": "fas",
10131013
}
10141014
}
@@ -1026,16 +1026,16 @@ exports[`SideBar Container Should render 1`] = `
10261026
>
10271027
<svg
10281028
aria-hidden="true"
1029-
className="svg-inline--fa fa-info-circle fa-w-16 "
1030-
data-icon="info-circle"
1029+
className="svg-inline--fa fa-home fa-w-18 "
1030+
data-icon="home"
10311031
data-prefix="fas"
10321032
role="img"
10331033
style={Object {}}
1034-
viewBox="0 0 512 512"
1034+
viewBox="0 0 576 512"
10351035
xmlns="http://www.w3.org/2000/svg"
10361036
>
10371037
<path
1038-
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
1038+
d="M488 312.7V456c0 13.3-10.7 24-24 24H348c-6.6 0-12-5.4-12-12V356c0-6.6-5.4-12-12-12h-72c-6.6 0-12 5.4-12 12v112c0 6.6-5.4 12-12 12H112c-13.3 0-24-10.7-24-24V312.7c0-3.6 1.6-7 4.4-9.3l188-154.8c4.4-3.6 10.8-3.6 15.3 0l188 154.8c2.7 2.3 4.3 5.7 4.3 9.3zm83.6-60.9L488 182.9V44.4c0-6.6-5.4-12-12-12h-56c-6.6 0-12 5.4-12 12V117l-89.5-73.7c-17.7-14.6-43.3-14.6-61 0L4.4 251.8c-5.1 4.2-5.8 11.8-1.6 16.9l25.5 31c4.2 5.1 11.8 5.8 16.9 1.6l235.2-193.7c4.4-3.6 10.8-3.6 15.3 0l235.2 193.7c5.1 4.2 12.7 3.5 16.9-1.6l25.5-31c4.2-5.2 3.4-12.7-1.7-16.9z"
10391039
fill="currentColor"
10401040
style={Object {}}
10411041
/>
@@ -1053,15 +1053,15 @@ exports[`SideBar Container Should render 1`] = `
10531053
>
10541054
<svg
10551055
aria-hidden="true"
1056-
class="svg-inline--fa fa-info-circle fa-w-16 "
1057-
data-icon="info-circle"
1056+
class="svg-inline--fa fa-home fa-w-18 "
1057+
data-icon="home"
10581058
data-prefix="fas"
10591059
role="img"
1060-
viewBox="0 0 512 512"
1060+
viewBox="0 0 576 512"
10611061
xmlns="http://www.w3.org/2000/svg"
10621062
>
10631063
<path
1064-
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
1064+
d="M488 312.7V456c0 13.3-10.7 24-24 24H348c-6.6 0-12-5.4-12-12V356c0-6.6-5.4-12-12-12h-72c-6.6 0-12 5.4-12 12v112c0 6.6-5.4 12-12 12H112c-13.3 0-24-10.7-24-24V312.7c0-3.6 1.6-7 4.4-9.3l188-154.8c4.4-3.6 10.8-3.6 15.3 0l188 154.8c2.7 2.3 4.3 5.7 4.3 9.3zm83.6-60.9L488 182.9V44.4c0-6.6-5.4-12-12-12h-56c-6.6 0-12 5.4-12 12V117l-89.5-73.7c-17.7-14.6-43.3-14.6-61 0L4.4 251.8c-5.1 4.2-5.8 11.8-1.6 16.9l25.5 31c4.2 5.1 11.8 5.8 16.9 1.6l235.2-193.7c4.4-3.6 10.8-3.6 15.3 0l235.2 193.7c5.1 4.2 12.7 3.5 16.9-1.6l25.5-31c4.2-5.2 3.4-12.7-1.7-16.9z"
10651065
fill="currentColor"
10661066
/>
10671067
</svg>

src/app/components/Leaderboard/LeaderboardElement.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ export class LeaderboardElement extends React.Component<
274274
}}
275275
title={player.username}
276276
>
277-
<span style={{ fontFamily: 'Lato' }}>{`${player.username.substr(0, 15)}${
278-
player.username.length > 15 ? '...' : ''
277+
<span style={{ fontFamily: 'Lato' }}>{`${player.username.substr(0, 20)}${
278+
player.username.length > 20 ? '...' : ''
279279
}`}</span>
280280
</div>
281281
<div

src/app/components/Leaderboard/index.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,12 @@ export class Leaderboard extends React.Component<
195195

196196
<Table responsive>
197197
<thead className={classnames('py-2 pl-3', styles.leaderboardTitle)}>
198-
<th className="text-light font-weight-bold my-auto">RANK</th>
199-
<th className="text-light font-weight-bold my-auto">NAME</th>
198+
<th className="text-light font-weight-bold my-auto" style={{ width: 1 }}>
199+
RANK
200+
</th>
201+
<th className="text-light font-weight-bold my-auto" style={{ width: 1 }}>
202+
NAME
203+
</th>
200204
<th className="text-light font-weight-bold my-auto">RATING</th>
201205
<th className="text-light font-weight-bold my-auto">WON</th>
202206
<th className="text-light font-weight-bold my-auto">TIED</th>

src/app/components/PopUpMenu.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class PopUpMenu extends React.Component<{}, ElementOwnProps> {
3737
<div onClick={this.togglePopUp}>
3838
<FontAwesomeIcon icon={faTimes} className={classnames(styles['close-icon'])} />
3939
</div>
40-
<a href="https://code.pragyan.org/docs" target="_blank">
40+
<a href="https://code.pragyan.org/docs/" target="_blank">
4141
<div className={classnames(styles['menu-item'], styles['menu-item-pragyan'])}>
4242
<div className={classnames(styles['menu-icon-documentation'])}>
4343
<FontAwesomeIcon icon={faBook} />
@@ -49,7 +49,7 @@ export default class PopUpMenu extends React.Component<{}, ElementOwnProps> {
4949
<div className={classnames(styles['menu-item'], styles['menu-item-documentation'])}>
5050
<div>
5151
<img
52-
src="https://www.pragyan.org/21/cms/templates/common/site/images/favicon.ico"
52+
src="https://www.pragyan.org/21/cms/templates/common/favicon.ico"
5353
alt="pragyan"
5454
width="25px"
5555
height="22px"

src/app/components/ReactTour.tsx

+16
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,22 @@ const tourConfig: ReactourStep[] = [
159159
position: 'bottom',
160160
selector: '[id="submit_button"]',
161161
},
162+
{
163+
content: () => (
164+
<div>
165+
<h6>Quest</h6>
166+
<p className={classnames(styles['step-description'])}>
167+
With the help of Quest mode, you can learn the game from absolute
168+
scratch.
169+
<br />
170+
There are various levels of increasing difficulty. Each level has a 3 star rating,
171+
which lets you know how competitive your code was against that particular bot.
172+
</p>
173+
</div>
174+
),
175+
position: 'bottom',
176+
selector: '[id="quest_button"]',
177+
},
162178
{
163179
content: () => (
164180
<div>

src/app/components/SideBar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
faCode,
55
faCodeBranch,
66
faCog,
7-
faInfoCircle,
7+
faHome,
88
faQuestionCircle,
99
faSignInAlt,
1010
faSignOutAlt,
@@ -185,7 +185,7 @@ export class Sidebar extends React.Component<SideBarInterfaces.Props, {}> {
185185
to="/home"
186186
onClick={() => clearAllLogs()}
187187
>
188-
<FontAwesomeIcon icon={faInfoCircle} />
188+
<FontAwesomeIcon icon={faHome} />
189189
</Link>
190190
</Tooltip>
191191
<Tooltip title="Take a tour" placement="right">

src/app/components/StoryModeModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class StoryModeModal extends React.Component<StoryModalPropType.Props, {}
1818
<Modal.Header>
1919
<Modal.Title>
2020
<div style={{ margin: 0 }}>
21-
<b>Level {level} !! </b>
21+
<b>Level {level}</b>
2222
{[...Array(stars >= 0 ? stars : 0)].map(() => (
2323
<FontAwesomeIcon icon={faStar} style={{ color: 'gold' }} />
2424
))}

src/app/components/SubmitBar/DropDownItem.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export class DropDownItem extends React.Component<DropDownItemInterfaces.Props,
1919
setCurrentLevel(Number(level), rating);
2020
toggleStoryModeModal(Number(level));
2121
}}
22+
style={{ cursor: 'pointer' }}
2223
>
2324
<span>LVL {level}</span>
2425
<DeltaStarCount rating={rating} />

src/app/components/home/Footer.tsx

+23-17
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,37 @@ export const Footer: React.FunctionComponent = () => {
2121
<div className={classnames('container-fluid', style.footer_head)}>
2222
<footer className="container py-5">
2323
<div className="row justify-content-md-around">
24-
<div className="col col-md-3">
24+
<div className="col col-md-6">
2525
<h5>Contact</h5>
26-
<ul className="list-unstyled text-small">
27-
<Table>
28-
<tbody>
29-
<tr onClick={() => copyToClipboard('9994479069')}>
30-
<td>Mandeep</td>
31-
<td>9994479069</td>
32-
</tr>
33-
<tr onClick={() => copyToClipboard('9566541342')}>
34-
<td>Kumaran</td>
35-
<td>9566541342</td>
36-
</tr>
37-
</tbody>
38-
</Table>
39-
</ul>
26+
<Table className="contact-table">
27+
<tbody>
28+
<tr onClick={() => copyToClipboard('9790432692')}>
29+
<td>Lakshmanan R</td>
30+
<td>9790432692</td>
31+
</tr>
32+
<tr onClick={() => copyToClipboard('8879672720')}>
33+
<td>Rigved</td>
34+
<td>8879672720</td>
35+
</tr>
36+
<tr onClick={() => copyToClipboard('8130964865')}>
37+
<td>Yash</td>
38+
<td>8130964865</td>
39+
</tr>
40+
<tr onClick={() => copyToClipboard('9884052296')}>
41+
<td>Ram T N</td>
42+
<td>9884052296</td>
43+
</tr>
44+
</tbody>
45+
</Table>
4046
</div>
4147
<div className="col col-md-3">
4248
<h5>Quick Links</h5>
4349
<ul className="list-unstyled text-small">
4450
<li>
45-
<Link to="/">Home</Link>
51+
<Link to="/">Dashboard</Link>
4652
</li>
4753
<li>
48-
<a href="https://code.pragyan.org/docs">Documentation</a>
54+
<a href="https://code.pragyan.org/docs/">Documentation</a>
4955
</li>
5056
<li>
5157
<a href="https://www.pragyan.org/21/home/events/bytehoc/code_character/">

src/app/components/home/LandingPage.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class LandingPage extends React.Component<LandingPageInterfaces.Props, {}
1919
},
2020
{
2121
answer:
22-
'Yes! Code Character is played completely on the web. However, we provide functionality for you to write code offline on your own text editor and compile the code. For more details, check out the player docs <a href="https://code.pragyan.org/docs">code.pragyan.org/docs</a>',
22+
'Yes! Code Character is played completely on the web. However, we provide functionality for you to write code offline on your own text editor and compile the code. For more details, check out the player docs <a href="https://code.pragyan.org/docs/">code.pragyan.org/docs/</a>',
2323
question: 'Is the event completely online?',
2424
},
2525
{
@@ -74,7 +74,7 @@ export class LandingPage extends React.Component<LandingPageInterfaces.Props, {}
7474
</ul>
7575
<p>
7676
Go through the{' '}
77-
<a href="https://code.pragyan.org/docs" target="_blank">
77+
<a href="https://code.pragyan.org/docs/" target="_blank">
7878
docs
7979
</a>{' '}
8080
and start playing!

src/app/data/questData.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const urlToDocs = 'https://delta.nitt.edu/codecharacter-docs/';
1+
const urlToDocs = 'https://code.pragyan.org/docs/';
22

33
export const levels = [
44
{

src/app/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const App = hot(module)(() => (
2929
<Route exact path={Routes.USER_PROFILE_MODEL} component={UserProfileModal} />
3030
<Route path={Routes.USER_ACTIVATION} component={ActivateUser} />
3131
<Route exact path={Routes.HOME} component={LandingPage} />
32+
<Route component={Dashboard} />
3233
</Switch>
3334
</BrowserRouter>
3435
</React.Fragment>

src/app/styles/Footer.module.css

+4
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,7 @@ textarea {
7070
color: yellowgreen;
7171
text-decoration: none;
7272
}
73+
74+
:global(.contact-table *) {
75+
text-align: left !important;
76+
}

0 commit comments

Comments
 (0)