Skip to content

Commit

Permalink
Merge pull request #27 from microsoft/anpethel/cc2024UI
Browse files Browse the repository at this point in the history
changes that improve ui
  • Loading branch information
WonSong authored Sep 17, 2024
2 parents d3df53d + bf12e50 commit 60c12d3
Show file tree
Hide file tree
Showing 13 changed files with 10,724 additions and 5,200 deletions.
15,835 changes: 10,654 additions & 5,181 deletions Client/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-private-property-in-object": "^7.24.7",
"sass": "^1.78.0"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Client/public/Flat_logo_linear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Client/public/Microsoft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Client/src/components/Form/TextField/TextField.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "../../../variables.scss";

.text-field-container {
margin-top: 20px;
margin-bottom: 20px;
}

Expand All @@ -17,6 +18,7 @@
font-size: 1em;
padding: 12px;
border: 1px solid $border-color-light;
border-radius: 15px;

@media (prefers-color-scheme: dark) {
background-color: $input-background-dark;
Expand Down
3 changes: 3 additions & 0 deletions Client/src/components/Form/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type TextFieldProps = {
value: string | number;
multiline?: boolean;
label?: string;
placeholder?: string;
};

export function TextField(props: TextFieldProps): React.ReactElement {
Expand All @@ -25,6 +26,7 @@ export function TextField(props: TextFieldProps): React.ReactElement {
props.onChange(props.name, e.currentTarget.value);
}}
value={props.value}
placeholder={props.placeholder || ""}
/>
</div>
);
Expand All @@ -45,6 +47,7 @@ export function TextField(props: TextFieldProps): React.ReactElement {
props.onChange(props.name, e.currentTarget.value);
}}
value={props.value}
placeholder={props.placeholder || ""}
/>
</div>
);
Expand Down
9 changes: 9 additions & 0 deletions Client/src/components/Layout/Footer/Footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@
.footer {
height: 50px;
padding: 20px;
margin-bottom: 20px;
border-top: 1px solid $border-color-light;

@media (prefers-color-scheme: dark) {
border-top: 1px solid $border-color-dark;
}
}

.footer-logo {
max-height: 30px;
// height: 30px;
width: auto;
margin-right: 10px;
// margin-bottom: 20px;
}
8 changes: 7 additions & 1 deletion Client/src/components/Layout/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import "./Footer.scss";
export function Footer(): React.ReactElement {
return (
<footer className="footer">
<div>Footer area if needed</div>
<div>
<img
src="Microsoft.png"
alt="Microsoft logo"
className="footer-logo"
/>
</div>
</footer>
);
}
8 changes: 8 additions & 0 deletions Client/src/components/Layout/Header/Header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
align-items: center;
padding-left: 20px;
padding-right: 20px;
margin-top: 10px;
border-bottom: 1px solid $border-color-light;

@media (prefers-color-scheme: dark) {
Expand All @@ -29,3 +30,10 @@
color: $font-text-dark;
}
}

.header-logo {
max-height: 50px;
// height: 30px;
width: auto;
margin-right: 10px;
}
9 changes: 8 additions & 1 deletion Client/src/components/Layout/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ export function Header(): React.ReactElement {
return (
<header className="header-root">
<a href="/" title="Go to CareerCraft home page" className="brand-link">
<div className="brand">CareerCraft</div>
<div className="brand">
<img
src="Flat_logo_linear.png"
// src="CareerCraft_logo_white_no_border_with_slogan_large.png"
alt="CareerCraft logo"
className="header-logo"
/>
</div>
</a>
</header>
);
Expand Down
8 changes: 8 additions & 0 deletions Client/src/components/Layout/Layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
flex-grow: 1;
}

.start-screen-center {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}

.footer-container {
flex-shrink: 0;
}
40 changes: 23 additions & 17 deletions Client/src/screens/StartScreen/StartScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,44 @@ import { Spinner } from "../../components/Spinner";

export function StartScreen(): React.ReactElement {
usePageTracking("StartScreen");

const [isSaving, setSaving] = React.useState<boolean>(false);
const { setGameScenarios } = React.useContext<IAppContext>(AppContext);
const [title, setTitle] = React.useState<string>("");
const navigate = useNavigate();

const handleStartButtonClicked = async () => {
const handleStartButtonClicked = async (): Promise<void> => {
setSaving(true);
const response = await Http.getInstance().post<GameScenarios>(
"/api/career-game/start",
{
careerChoice: title,
}
);
try {
const response = await Http.getInstance().post<GameScenarios>(
"/api/career-game/start",
{
careerChoice: title,
}
);

if (response.ok) {
setGameScenarios(response.data);
navigate(`/career-game/something`);
if (response.ok) {
setGameScenarios(response.data);
navigate(`/career-game/something`);
}
} catch (error) {
console.error("Failed to start game", error);
} finally {
setSaving(false);
}

setSaving(false);
};

return (
<div>
<H1>Start Screen</H1>
<div className="start-screen-center">
<H1>Welcome! What career would you like to explore?</H1>

<TextField
label="Title"
name="title"
onChange={(name, title: string) => {
setTitle(title);
onChange={(name: string, value: string) => {
setTitle(value);
}}
value={title}
placeholder="Enter a career title"
/>

<ButtonBar>
Expand Down

0 comments on commit 60c12d3

Please sign in to comment.