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

UI updates (first pass) #181

Merged
merged 18 commits into from
Aug 22, 2023
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
2 changes: 1 addition & 1 deletion frontend/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

html,
body {
background: $background;
background: $gray-110;
font-family: $font-family-inter;
font-size: $font-size-normal;
font-style: normal;
Expand Down
19 changes: 11 additions & 8 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
withRouter,
} from "react-router-dom";
import { Toaster } from "react-hot-toast";
import { RouteWithLayout } from "./components/layout/Layout";
import { RouteWithProjectLayout } from "./components/layout/Layout";
import { routes } from "./constants/routes";
import { UiStateContextProvider } from "./contexts/ui-state.context";
import "./App.scss";
Expand Down Expand Up @@ -102,16 +102,19 @@ export const FlowserRoutes = (): ReactElement => {
<ProjectRequirements />
<Switch>
<Route path={routes.start} component={Start} />
<RouteWithLayout path={routes.accounts} component={Accounts} />
<RouteWithLayout path={routes.blocks} component={Blocks} />
<RouteWithLayout path={routes.transactions} component={Transactions} />
<RouteWithLayout path={routes.contracts} component={Contracts} />
<RouteWithLayout path={routes.events} component={Events} />
<RouteWithLayout
<RouteWithProjectLayout path={routes.accounts} component={Accounts} />
<RouteWithProjectLayout path={routes.blocks} component={Blocks} />
<RouteWithProjectLayout
path={routes.transactions}
component={Transactions}
/>
<RouteWithProjectLayout path={routes.contracts} component={Contracts} />
<RouteWithProjectLayout path={routes.events} component={Events} />
<RouteWithProjectLayout
path={routes.interactions}
component={InteractionsPage}
/>
<RouteWithLayout
<RouteWithProjectLayout
path={routes.configureCurrent}
component={Configuration}
/>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/assets/icons/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 0 additions & 12 deletions frontend/src/assets/icons/open_project.svg

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/src/assets/icons/yellow_line.svg

This file was deleted.

8 changes: 3 additions & 5 deletions frontend/src/components/breadcrumbs/Breadcrumbs.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
.root {
display: flex;
height: 50px;
padding: 0 $spacing-base - 2px;
padding: 0 $spacing-base;
border-radius: $border-radius-card;
align-items: center;
background: $medium-violet;
margin: 0 $spacing-l;

.backButtonWrapper {
width: 40px;
Expand Down Expand Up @@ -39,13 +37,13 @@
display: flex;
align-items: center;

& span {
.arrow {
margin: 0 $spacing-base * 0.5;
}

* {
font-family: $font-family-inter;
font-size: $font-size-small - 1px;
font-size: $font-size-normal;
color: $color-grey;
text-decoration: none;
}
Expand Down
14 changes: 10 additions & 4 deletions frontend/src/components/breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ import { NavLink, useHistory } from "react-router-dom";
import { useNavigation } from "../../hooks/use-navigation";
import classes from "./Breadcrumbs.module.scss";
import { ReactComponent as IconBackButton } from "../../assets/icons/back-button.svg";
import classNames from "classnames";

export function Breadcrumbs(): ReactElement | null {
const breadCrumbsBarHeight = 50;
type BreadcrumbsProps = {
className?: string;
};

export function Breadcrumbs(props: BreadcrumbsProps): ReactElement | null {
const { isShowBackButtonVisible, isBreadcrumbsVisible, breadcrumbs } =
useNavigation();
const history = useHistory();
Expand All @@ -20,7 +24,7 @@ export function Breadcrumbs(): ReactElement | null {
}

return (
<div className={classes.root}>
<div className={classNames(classes.root, props.className)}>
{isShowBackButtonVisible && (
<div className={classes.backButtonWrapper} onClick={onBack}>
<IconBackButton className={classes.backButton} />
Expand All @@ -35,7 +39,9 @@ export function Breadcrumbs(): ReactElement | null {
))
.reduce((prev, curr, i) => [
prev,
<span key={++i}>{">>"}</span>,
<span key={++i} className={classes.arrow}>
{">>"}
</span>,
curr,
])}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

.header {
transition: 0.3s;
color: $light-grey;
color: $gray-10;
}

.footer {
color: $light-grey;
color: $gray-10;
opacity: 0.5;
font-size: $font-size-small;
}
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/buttons/button/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

.button {
position: relative;
background-color: $yellow;
background-color: $violet-100;
border-radius: $border-radius-button;
color: $background;
color: $white;
font-size: $font-size-big;
font-family: $font-family-inter;
letter-spacing: $character-spacing-medium;
font-style: normal;
font-weight: bold;
border: 2px solid $yellow;
border: 2px solid $violet-100;
cursor: pointer;

&:hover {
Expand Down Expand Up @@ -47,7 +47,7 @@
}

.normal {
background: $yellow;
background: $violet-100;
height: 32px;
padding: 0 18px;
font-size: $font-size-xsmall !important;
Expand Down Expand Up @@ -83,7 +83,7 @@

.outlined {
background: none;
color: $yellow;
color: $white;

&.disabled {
color: $color-not-active-button-text-grey;
Expand Down
19 changes: 15 additions & 4 deletions frontend/src/components/buttons/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { FunctionComponent, HTMLAttributes } from "react";
import classes from "./Button.module.scss";
import Loader from "react-loader-spinner";
import classNames from "classnames";

export type ButtonProps = React.DetailedHTMLProps<
React.ButtonHTMLAttributes<HTMLButtonElement>,
Expand Down Expand Up @@ -28,16 +29,26 @@ const Button: FunctionComponent<ButtonProps> = ({
{...restProps}
onClick={onClick}
disabled={disabled}
className={`${classes.button} ${classes[variant]} ${
disabled ? classes.disabled : ""
} ${restProps.className} ${outlined ? classes.outlined : ""}`}
className={classNames(
classes.button,
classes[variant],
restProps.className,
{
[classes.disabled]: disabled,
[classes.outlined]: outlined,
}
)}
>
{loading && (
<div className={classes.loaderWrapper}>
<Loader type="Oval" color={loaderColor} height={25} width={25} />
</div>
)}
<div className={loading ? classes.hiddenChildren : ""}>
<div
className={classNames({
[classes.hiddenChildren]: loading,
})}
>
{restProps.children}
</div>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
& > span {
display: block;
visibility: visible;
background-color: $light-grey;
background-color: $gray-10;
border-radius: 50%;
width: 10px;
height: 10px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
&.inactive {
transform: translateX(0);
transition: all 100ms;
background-color: #5B5E62;
background-color: $gray-30;
}

&.disabled {
background-color: $dark-grey;
background-color: $gray-50;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/cadence-editor/cadence-editor.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* Main editor container */
.cadence-editor {
width: 100%;
background: #272B32;
}

.cadence-editor .cm-editor {
Expand Down
30 changes: 0 additions & 30 deletions frontend/src/components/card/Card.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,4 @@
@include addNewContentAnimation(.4s);
}

.loading {
position: absolute;
display: flex;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: $table-line-background;
align-items: center;
justify-content: center;
color: $light-grey;
opacity: 0.8;
}

&.header-row {
background-color: $dark-violet;
color: $grey;
}

&.table-line {
background-color: $table-line-background;
}

&.dark-blue {
//background-color: $dark-blue;
}

&.active {
border: 1px solid $yellow;
}
}
16 changes: 5 additions & 11 deletions frontend/src/components/card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
import React, { FunctionComponent, HTMLAttributes } from "react";
import classes from "./Card.module.scss";
import classNames from "classnames";

type CardProps = HTMLAttributes<HTMLDivElement> & {
className?: string;
variant?: "table-line" | "black" | "header-row" | "dark-blue";
active?: boolean;
loading?: boolean;
showIntroAnimation?: boolean;
loadingText?: string;
};

const Card: FunctionComponent<CardProps> = ({
children,
className,
variant = "dark-blue",
active = false,
loading = false,
loadingText = "Loading ...",
showIntroAnimation,
...restProps
}) => {
return (
<div
className={`${classes.root} ${classes[variant]} ${
// TODO: fix the possibly undefined index "variant"
active ? classes.active : ""
} ${className} ${showIntroAnimation ? classes.introAnimation : ""}`}
className={classNames(classes.root, className, {
[classes.active]: active,
[classes.introAnimation]: showIntroAnimation,
})}
{...restProps}
>
{loading && <span className={classes.loading}>{loadingText}</span>}
{children}
</div>
);
Expand Down
60 changes: 0 additions & 60 deletions frontend/src/components/collapsible-card/Collapsible.module.scss

This file was deleted.

Loading