mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
fixed lab header colors
This commit is contained in:
parent
26a061026f
commit
61326f237f
8 changed files with 63 additions and 18 deletions
|
@ -1,6 +1,6 @@
|
||||||
NEXT_PUBLIC_API_HOST=https://pig.staging.vault48.org/
|
#NEXT_PUBLIC_API_HOST=https://pig.staging.vault48.org/
|
||||||
NEXT_PUBLIC_REMOTE_CURRENT=https://pig.staging.vault48.org/static/
|
#NEXT_PUBLIC_REMOTE_CURRENT=https://pig.staging.vault48.org/static/
|
||||||
#NEXT_PUBLIC_API_HOST=http://localhost:8888/
|
NEXT_PUBLIC_API_HOST=http://localhost:8888/
|
||||||
#NEXT_PUBLIC_REMOTE_CURRENT=http://localhost:8888/static/
|
NEXT_PUBLIC_REMOTE_CURRENT=http://localhost:8888/static/
|
||||||
#NEXT_PUBLIC_API_HOST=https://pig.vault48.org/
|
#NEXT_PUBLIC_API_HOST=https://pig.vault48.org/
|
||||||
#NEXT_PUBLIC_REMOTE_CURRENT=https://pig.vault48.org/static/
|
#NEXT_PUBLIC_REMOTE_CURRENT=https://pig.vault48.org/static/
|
||||||
|
|
|
@ -18,6 +18,7 @@ const LabHead: FC<IProps> = ({ isLoading }) => {
|
||||||
<Group className={styles.wrap} horizontal>
|
<Group className={styles.wrap} horizontal>
|
||||||
<div className={styles.group}>
|
<div className={styles.group}>
|
||||||
<LabHeadItem
|
<LabHeadItem
|
||||||
|
color="green"
|
||||||
icon="recent"
|
icon="recent"
|
||||||
active={sort === LabNodesSort.New}
|
active={sort === LabNodesSort.New}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
|
@ -27,6 +28,7 @@ const LabHead: FC<IProps> = ({ isLoading }) => {
|
||||||
</LabHeadItem>
|
</LabHeadItem>
|
||||||
|
|
||||||
<LabHeadItem
|
<LabHeadItem
|
||||||
|
color="orange"
|
||||||
icon="hot"
|
icon="hot"
|
||||||
active={sort === LabNodesSort.Hot}
|
active={sort === LabNodesSort.Hot}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
|
@ -34,6 +36,16 @@ const LabHead: FC<IProps> = ({ isLoading }) => {
|
||||||
>
|
>
|
||||||
Популярные
|
Популярные
|
||||||
</LabHeadItem>
|
</LabHeadItem>
|
||||||
|
|
||||||
|
<LabHeadItem
|
||||||
|
color="yellow"
|
||||||
|
icon="star_full"
|
||||||
|
isLoading={isLoading}
|
||||||
|
active={sort === LabNodesSort.Heroic}
|
||||||
|
onClick={() => setSort(LabNodesSort.Heroic)}
|
||||||
|
>
|
||||||
|
Важные
|
||||||
|
</LabHeadItem>
|
||||||
</div>
|
</div>
|
||||||
</Group>
|
</Group>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
@import "src/styles/variables.scss";
|
@import "src/styles/variables.scss";
|
||||||
|
|
||||||
.wrap {
|
.wrap {
|
||||||
@include inner_shadow;
|
|
||||||
|
|
||||||
border-radius: $radius;
|
border-radius: $radius;
|
||||||
background-color: $content_bg;
|
|
||||||
padding: 0 $gap * 0.5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.group {
|
.group {
|
||||||
|
@include inner_shadow;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
background-color: $content_bg;
|
||||||
|
border-radius: $radius;
|
||||||
|
|
||||||
@include tablet {
|
@include tablet {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: stretch;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
|
|
|
@ -10,12 +10,13 @@ import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
icon: string;
|
icon: string;
|
||||||
|
color: 'green' | 'orange' | 'yellow';
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LabHeadItem: FC<IProps> = ({ icon, children, isLoading, active, onClick }) => {
|
const LabHeadItem: FC<IProps> = ({ icon, color, children, isLoading, active, onClick }) => {
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<Group horizontal className={styles.item} key="loading">
|
<Group horizontal className={styles.item} key="loading">
|
||||||
|
@ -26,14 +27,13 @@ const LabHeadItem: FC<IProps> = ({ icon, children, isLoading, active, onClick })
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Group
|
<div
|
||||||
horizontal
|
className={classNames(styles.item, { [styles.active]: active }, styles[color])}
|
||||||
className={classNames(styles.item, { [styles.active]: active })}
|
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
>
|
>
|
||||||
<Icon icon={icon} size={24} />
|
<Icon icon={icon} size={24} />
|
||||||
<span className={styles.text}>{children}</span>
|
<span className={styles.text}>{children}</span>
|
||||||
</Group>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,21 +2,52 @@
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
padding: $gap * 0.5;
|
padding: $gap * 0.5 $gap * 1.5 $gap * 0.5 $gap;
|
||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
color: darken(white, 50%);
|
color: darken(white, 50%);
|
||||||
transition: color 0.25s;
|
transition: color 0.25s;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
border-radius: $radius;
|
||||||
|
min-height: 36px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@include tablet {
|
||||||
|
flex-direction: column;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
color: $wisegreen;
|
@include outer_shadow;
|
||||||
|
color: white;
|
||||||
|
|
||||||
|
&.green {
|
||||||
|
background: $green_gradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.orange {
|
||||||
|
background: $red_gradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.yellow {
|
||||||
|
background: $yellow_gradient;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
font: $font_16_semibold;
|
font: $font_14_semibold;
|
||||||
|
text-transform: uppercase;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
padding-left: $gap * 0.75;
|
||||||
|
|
||||||
|
@include tablet {
|
||||||
|
padding-top: $gap * 0.5;
|
||||||
|
font: $font_12_semibold;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,5 +49,5 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.head {
|
.head {
|
||||||
padding: 0 $gap * 0.5 $gap * 0.5;
|
padding: 0 $gap * 0.5 $gap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ $primary: $red;
|
||||||
$secondary: $wisegreen;
|
$secondary: $wisegreen;
|
||||||
|
|
||||||
$red_gradient: linear-gradient(165deg, $orange -50%, $red 150%);
|
$red_gradient: linear-gradient(165deg, $orange -50%, $red 150%);
|
||||||
|
$yellow_gradient: linear-gradient(165deg, $yellow -50%, $red 150%);
|
||||||
$blue_gradient: linear-gradient(170deg, $blue, $dark_blue);
|
$blue_gradient: linear-gradient(170deg, $blue, $dark_blue);
|
||||||
$green_gradient: linear-gradient(
|
$green_gradient: linear-gradient(
|
||||||
170deg,
|
170deg,
|
||||||
|
|
|
@ -22,6 +22,7 @@ export type ILabState = Readonly<{
|
||||||
export enum LabNodesSort {
|
export enum LabNodesSort {
|
||||||
New = 'new',
|
New = 'new',
|
||||||
Hot = 'hot',
|
Hot = 'hot',
|
||||||
|
Heroic = 'heroic',
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GetLabNodesRequest = {
|
export type GetLabNodesRequest = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue