Skip to content

Commit

Permalink
Merge pull request #191 from Emurgo/fix/text-styles
Browse files Browse the repository at this point in the history
fix(ui) text styles
  • Loading branch information
vsubhuman authored Mar 15, 2024
2 parents 42f2791 + 622fe26 commit fc90822
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 19 deletions.
27 changes: 13 additions & 14 deletions src/components/PoolSaturationTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import type { Node } from 'react';
import styled from 'styled-components';
import { PieChart } from 'react-minimal-pie-chart';
import { roundOneDecimal, } from '../utils/utils';
import { roundOneDecimal } from '../utils/utils';

const Tag = styled.div`
padding: 2px 8px;
Expand All @@ -16,34 +16,33 @@ const Tag = styled.div`
align-items: center;
.value {
margin-left: 6px;
color: #2B2C32;
color: #2b2c32;
font-size: 14px;
line-height: 22px;
}
.piechart {
width: 15px;
height: 15px;
margin-right: 5px;
@media (min-width:1125px) and (max-width: 1200px) {
@media (min-width: 1125px) and (max-width: 1200px) {
margin: 0;
}
}
@media (min-width:1125px) and (max-width: 1200px) {
@media (min-width: 1125px) and (max-width: 1200px) {
margin: 0;
margin-top: 4px;
}
@media (max-width: 1125px) {
margin-bottom: 8px;
}
`;

type Props = {|
+value: number,
|};

function PoolSaturationTag({ value }: Props): Node {
const totalValue = 1
const totalValue = 1;
function formatArray(percent) {
return [
{
Expand Down Expand Up @@ -82,9 +81,9 @@ function PoolSaturationTag({ value }: Props): Node {
<div className="piechart">
<PieChart totalValue={totalValue} data={formatArray(value)} />
</div>
<div className="value">{roundOneDecimal(value*100)}%</div>
<div className="value">{roundOneDecimal(value * 100)}%</div>
</Tag>
)
);
}

const TagRevamp = styled.div`
Expand All @@ -97,7 +96,7 @@ const TagRevamp = styled.div`
align-items: center;
.value {
margin-left: 6px;
color: #2B2C32;
color: #2b2c32;
font-size: 16px;
line-height: 22px;
}
Expand All @@ -108,20 +107,20 @@ const TagRevamp = styled.div`
@media (max-width: 1125px) {
margin-bottom: 8px;
}
`;

function PoolSaturationTagRevamp({ value }: Props): Node {
const totalValue = 1;
const roundedSaturationValue = roundOneDecimal(value * 100);
function formatArray(percent) {
return [
{
value: percent,
color: '#DBE0E9',
color: value > 0.6 ? '#ED8600' : '#000000',
},
{
value: totalValue - percent,
color: '#A7AFC0',
color: '#DBE0E9',
},
];
}
Expand All @@ -130,10 +129,10 @@ function PoolSaturationTagRevamp({ value }: Props): Node {
<div className="piechart">
<PieChart totalValue={totalValue} data={formatArray(value)} />
</div>
<div className="value">{roundOneDecimal(value*100)}%</div>
<div className="value">{roundedSaturationValue}%</div>
</TagRevamp>
);
}

export default PoolSaturationTag;
export { PoolSaturationTagRevamp };
export { PoolSaturationTagRevamp };
6 changes: 5 additions & 1 deletion src/components/SearchRevamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import searchIcon from '../assets/search-icon.svg';
const Form = styled.form`
display: flex;
position: relative;
margin-right: 1px;
`;
const SearchInput = styled.input`
height: 40px;
Expand All @@ -32,7 +33,7 @@ const SearchInput = styled.input`
}
:focus {
outline: 2px solid #242838;
outline: 1px solid #242838;
}
`;
const SearchBtn = styled.button`
Expand Down Expand Up @@ -98,6 +99,7 @@ const SearchRevamp = ({ filter }: Props): Node => {
placeholder="Search stake pool"
type="text"
/>
{searchValue.length > 0 &&
<ClearBtn
onClick={(e) => {
setSearchValue('');
Expand All @@ -106,6 +108,8 @@ const SearchRevamp = ({ filter }: Props): Node => {
>
<img src={closeIcon} alt="Clear Input" />
</ClearBtn>
}

</Form>
);
};
Expand Down
4 changes: 3 additions & 1 deletion src/components/common/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ const BtnRevampWrapper = styled.button`
box-sizing: border-box;
min-width: 120px;
padding: 9px 20px;
font-size: 16px;
font-size: 14px;
font-weight: 500;
color: #4b6dde;
background: none;
border: 0;
border-radius: 8px;
width: 100%;
text-transform: uppercase;
cursor: pointer;
letter-spacing: 0.5px;
&:hover {
color: #3154cb;
background-color: #f0f3f5;
Expand Down
9 changes: 6 additions & 3 deletions src/containers/HomeRevamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const Header = styled.div`
}
`;
const Title = styled.h1`
color: #38393d;
color: #000;
font-weight: 500;
font-size: 18px;
@media (max-width: 1125px) {
margin-bottom: 20px;
Expand Down Expand Up @@ -122,8 +123,10 @@ const SORTING_FUNCTIONS = {
a.total_size - b.total_size,
[`${Sorting.POOL_SIZE}_${SortingDirections.DESC}`]: (a: Pool, b: Pool) =>
b.total_size - a.total_size,
[`${Sorting.SATURATION}_${SortingDirections.ASC}`]: (a: Pool, b: Pool) => a.saturation - b.saturation,
[`${Sorting.SATURATION}_${SortingDirections.DESC}`]: (a: Pool, b: Pool) => b.saturation - a.saturation,
[`${Sorting.SATURATION}_${SortingDirections.ASC}`]: (a: Pool, b: Pool) =>
a.saturation - b.saturation,
[`${Sorting.SATURATION}_${SortingDirections.DESC}`]: (a: Pool, b: Pool) =>
b.saturation - a.saturation,
[`${Sorting.PLEDGE}_${SortingDirections.ASC}`]: (a: Pool, b: Pool) =>
Number(a.pledge) - Number(b.pledge),
[`${Sorting.PLEDGE}_${SortingDirections.DESC}`]: (a: Pool, b: Pool) =>
Expand Down
18 changes: 18 additions & 0 deletions src/helpers/globalStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,24 @@ td {
font-family: 'Rubik', sans-serif;
}
/* width */
::-webkit-scrollbar {
width: 8px;
}
/* Track */
::-webkit-scrollbar-track {
backgroud-color:transparent;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #c8ccce;
border-radius: 12px;
border: 7px solid transparent,
}
html {
font-size: 62.5%;
}
Expand Down

0 comments on commit fc90822

Please sign in to comment.