Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Components modification for new TXs tab. #37

Merged
merged 31 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2bb1736
Add table component
alongoni Jul 1, 2020
d2d598e
refactor Table
nicosampler Jul 13, 2020
bda7d52
add collapsible functionality
nicosampler Jul 14, 2020
522f294
remove makeStyles
nicosampler Jul 14, 2020
8bcc943
rename types
nicosampler Jul 15, 2020
30622e5
change export
nicosampler Jul 15, 2020
80d841d
headers fix
nicosampler Jul 15, 2020
fdc6875
Merge branch 'development' into table
nicosampler Jul 15, 2020
3217318
default values and content colspan
nicosampler Jul 16, 2020
5ff0268
fix collapsable padding
alongoni Jul 17, 2020
c86d0d2
Icon tooltip
nicosampler Jul 17, 2020
d98efcc
Text tooltip
nicosampler Jul 17, 2020
a3a1d6b
Loader color
nicosampler Jul 17, 2020
f396ff5
Adding StatusDot
nicosampler Jul 17, 2020
9cabc30
Merge remote-tracking branch 'origin/table' into issue-36
nicosampler Jul 20, 2020
adb8394
remove unused code
nicosampler Jul 20, 2020
a090eab
functions types
nicosampler Jul 20, 2020
6bef5f2
Merge branch 'development' of github.com:gnosis/safe-react-components…
mmv08 Jul 21, 2020
78d4c76
add eslint-plugin-flowtype
mmv08 Jul 21, 2020
e418356
dep bump, update eslint config
mmv08 Jul 21, 2020
81f1d2f
turn off proptypes in eslint
mmv08 Jul 21, 2020
bd6f162
prettier fixes
mmv08 Jul 21, 2020
b37f7ed
lint fixes
nicosampler Jul 21, 2020
57c3187
run lint with --fix
nicosampler Jul 21, 2020
5212fa6
more lint fixes
nicosampler Jul 21, 2020
3c44322
fix card
nicosampler Jul 21, 2020
5ec4221
fix simple warnings
nicosampler Jul 21, 2020
2810382
fix Icon story type
nicosampler Jul 21, 2020
5e520e7
review changes
nicosampler Jul 22, 2020
a2e112a
theme types
nicosampler Jul 22, 2020
49c5361
lint fixes
nicosampler Jul 22, 2020
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
23 changes: 17 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"react-app",
"prettier",
"prettier/react",
"plugin:import/errors",
"plugin:@typescript-eslint/recommended"
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"plugins": ["prettier", "import"]
"plugins": ["react-hooks"],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/prop-types": "off"
}
}
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"jsxBracketSameLine": true,
"printWidth": 80,
"singleQuote": true,
"trailingComma": "none",
"trailingComma": "es5",
"tabWidth": 2,
"useTabs": false
}
24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"build": "rimraf dist && webpack --mode production",
"build-storybook": "build-storybook -s public --docs",
"storybook": "start-storybook -p 9009 -s public --docs",
"lint:check": "eslint './src/**/*.{js,jsx,ts,tsx}'",
"prepare": "yarn build"
},
"author": "Gnosis (https://gnosis.pm)",
Expand All @@ -40,34 +41,31 @@
"@testing-library/user-event": "10.3.1",
"@types/big.js": "^4.0.5",
"@types/classnames": "^2.2.10",
"@types/jest": "26.0.3",
"@types/jest": "26.0.5",
"@types/material-ui": "^0.21.7",
"@types/node": "14.0.14",
"@types/react": "16.9.41",
"@types/node": "14.0.24",
"@types/react": "16.9.43",
"@types/react-dom": "16.9.8",
"@types/styled-components": "5.1.0",
"@types/styled-components": "5.1.1",
"@types/yup": "0.29.3",
"@typescript-eslint/eslint-plugin": "^3.5.0",
"@typescript-eslint/parser": "^3.5.0",
"@typescript-eslint/eslint-plugin": "^3.7.0",
"@typescript-eslint/parser": "^3.7.0",
"awesome-typescript-loader": "^5.2.1",
"babel-eslint": "^10.0.3",
"babel-loader": "8.1.0",
"copy-webpack-plugin": "^5.1.1",
"eslint": "7.3.1",
"eslint": "7.5.0",
"eslint-config-prettier": "6.11.0",
"eslint-config-react-app": "5.2.1",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "3.1.4",
"eslint-plugin-react": "7.20.2",
"eslint-plugin-react-hooks": "4.0.4",
"eslint-plugin-react": "7.20.3",
"eslint-plugin-react-hooks": "4.0.8",
"ethereum-blockies-base64": "^1.0.2",
"prettier": "2.0.5",
"react": "16.13.1",
"react-dom": "16.13.1",
"rimraf": "^3.0.2",
"styled-components": "5.1.1",
"typescript": "3.9.5",
"typescript": "3.9.7",
"webpack": "4.43.0",
"webpack-cli": "^3.3.10",
"webpack-node-externals": "^1.7.2"
Expand Down
6 changes: 3 additions & 3 deletions src/dataDisplay/Card/card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export default {
title: 'Data Display/Card',
component: Card,
parameters: {
componentSubtitle: 'Useful to wrap content inside a styled container.'
}
componentSubtitle: 'Useful to wrap content inside a styled container.',
},
};

export const card = () => (
export const SimpleCard = (): React.ReactElement => (
<Card>
<Title size="xs">Some text</Title>
</Card>
Expand Down
13 changes: 11 additions & 2 deletions src/dataDisplay/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@ import React from 'react';
import styled from 'styled-components';
import { rgba } from 'polished';

const Card = styled.div`
const StyledCard = styled.div`
box-shadow: 1px 2px 10px 0
${({ theme }) => rgba(theme.colors.shadow.color, 0.08)};
border-radius: 8px;
padding: 24px;
background-color: ${({ theme }) => theme.colors.white};
`;

export default ({ ...args }) => <Card {...args} />;
type Props = {
className?: string;
children: React.ReactNode;
};

const Card = ({ className, children }: Props): React.ReactElement => (
<StyledCard className={className}>{children}</StyledCard>
);

export default Card;
6 changes: 3 additions & 3 deletions src/dataDisplay/Divider/divider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export default {
title: 'Data Display/Divider',
component: Divider,
parameters: {
componentSubtitle: 'Used to separate content.'
}
componentSubtitle: 'Used to separate content.',
},
};

export const section = () => (
export const Section = (): React.ReactElement => (
<>
<div>Some content</div>
<Divider />
Expand Down
12 changes: 10 additions & 2 deletions src/dataDisplay/Divider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import React from 'react';
import styled from 'styled-components';

const Divider = styled.div`
const StyledDivider = styled.div`
border-top: 2px solid ${({ theme }) => theme.colors.separator};
margin: 16px 0;
`;

export default ({ ...args }) => <Divider {...args} />;
type Props = {
className?: string;
};

const Divider = ({ className }: Props): React.ReactElement => (
<StyledDivider className={className} />
);

export default Divider;
10 changes: 5 additions & 5 deletions src/dataDisplay/FixedDialog/FixedDialog.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export default {
parameters: {
componentSubtitle: `It shows a Dialog, with a modal look and feels, but only being
rendered inside a container instead of taking position absolute.
`
}
`,
},
};

export const fixedDialog = () => (
export const SimpleFixedDialog = (): React.ReactElement => (
<FixedDialog
title="Legal Disclaimer"
body={<div>Some Body</div>}
onCancel={() => {}}
onConfirm={() => {}}
onCancel={() => undefined}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could've used console.log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we use console.log shouldn't it be a little noisy in production?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a story

onConfirm={() => undefined}
/>
);
7 changes: 6 additions & 1 deletion src/dataDisplay/FixedDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ type Props = {
onConfirm: () => void;
};

const FixedDialog = ({ body, title, onConfirm, onCancel }: Props) => {
const FixedDialog = ({
body,
title,
onConfirm,
onCancel,
}: Props): React.ReactElement => {
return (
<Container>
<Wrapper>
Expand Down
51 changes: 25 additions & 26 deletions src/dataDisplay/FixedIcon/fixedIcon.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React from 'react';
import styled from 'styled-components';

import FixedIcon from './index';
import FixedIcon, { IconTypes } from './index';

export default {
title: 'Data Display/FixedIcon',
component: FixedIcon,
parameters: {
componentSubtitle: `Components that renders an icon customized for Safe Multisig app, this icon is not
customizable by props. If you need generic purposes Icons, try Icon component.`
}
customizable by props. If you need generic purposes Icons, try Icon component.`,
},
};

export const icons = () => {
export const Icons = (): React.ReactElement => {
const Wrapper = styled.div`
display: flex;
flex-wrap: wrap;
Expand All @@ -32,29 +32,29 @@ export const icons = () => {
font-size: 14px;
`;

const icons: IconTypes[] = [
'arrowSort',
'connectedRinkeby',
'connectedWallet',
'bullit',
'dropdownArrowSmall',
'arrowReceived',
'arrowSent',
'threeDots',
'options',
'plus',
'chevronRight',
'chevronLeft',
'chevronUp',
'chevronDown',
'settingsChange',
'creatingInProgress',
'notOwner',
];

return (
<Wrapper>
{[
'arrowSort',
'connectedRinkeby',
'connectedWallet',
'bullit',
'dropdownArrowSmall',
'arrowReceived',
'arrowSent',
'threeDots',
'options',
'plus',
'chevronRight',
'chevronLeft',
'chevronUp',
'chevronDown',
'settingsChange',
'creatingInProgress',
'notOwner'


].map((type: any, index) => (
{icons.map((type, index) => (
<IconBox key={index}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could've used type as a key. This makes no different in this case, but just fyi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure to understand? could you give me an example?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<IconBox key={type}>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh yes! I was thinking about something with TS.

<FixedIcon type={type} />
{type}
Expand All @@ -63,4 +63,3 @@ export const icons = () => {
</Wrapper>
);
};

24 changes: 12 additions & 12 deletions src/dataDisplay/FixedIcon/images/arrowReceived.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react';

const icon = (
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 10 10">
<path
fill="#008C73"
fillRule="evenodd"
d="M3.431 7.99h2.6c.554 0 1.004.45 1.004 1.005C7.035 9.55 6.585 10 6.03 10H1.005c-.277 0-.529-.112-.71-.294C.111 9.524 0 9.272 0 8.995V3.97c0-.555.45-1.005 1.005-1.005.555 0 1.005.45 1.005 1.005v2.599L8.284.294c.393-.392 1.03-.392 1.422 0 .392.393.392 1.03 0 1.422L3.43 7.99z"
/>
</svg>
)
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 10 10">
<path
fill="#008C73"
fillRule="evenodd"
d="M3.431 7.99h2.6c.554 0 1.004.45 1.004 1.005C7.035 9.55 6.585 10 6.03 10H1.005c-.277 0-.529-.112-.71-.294C.111 9.524 0 9.272 0 8.995V3.97c0-.555.45-1.005 1.005-1.005.555 0 1.005.45 1.005 1.005v2.599L8.284.294c.393-.392 1.03-.392 1.422 0 .392.393.392 1.03 0 1.422L3.43 7.99z"
/>
</svg>
);

export default icon;
24 changes: 12 additions & 12 deletions src/dataDisplay/FixedIcon/images/arrowSent.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react';

const icon = (
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 10 10">
<path
fill="#F02525"
fillRule="evenodd"
d="M6.569 2.01h-2.6c-.554 0-1.004-.45-1.004-1.005C2.965.45 3.415 0 3.97 0h5.025c.277 0 .529.112.71.294.183.182.295.434.295.711V6.03c0 .555-.45 1.005-1.005 1.005-.555 0-1.005-.45-1.005-1.005V3.431L1.716 9.706c-.393.392-1.03.392-1.422 0-.392-.393-.392-1.03 0-1.422L6.57 2.01z"
/>
</svg>
)
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 10 10">
<path
fill="#F02525"
fillRule="evenodd"
d="M6.569 2.01h-2.6c-.554 0-1.004-.45-1.004-1.005C2.965.45 3.415 0 3.97 0h5.025c.277 0 .529.112.71.294.183.182.295.434.295.711V6.03c0 .555-.45 1.005-1.005 1.005-.555 0-1.005-.45-1.005-1.005V3.431L1.716 9.706c-.393.392-1.03.392-1.422 0-.392-.393-.392-1.03 0-1.422L6.57 2.01z"
/>
</svg>
);

export default icon;
24 changes: 12 additions & 12 deletions src/dataDisplay/FixedIcon/images/arrowSort.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react';

const icon = (
<svg
xmlns="http://www.w3.org/2000/svg"
width="8"
height="8"
viewBox="0 0 8 8">
<path
fill="#5D6D74"
fillRule="evenodd"
d="M4.984 4.608l1.302-1.322c.384-.384 1.024-.384 1.408 0 .384.384.384 1.024 0 1.408L4.728 7.702C4.537 7.893 4.28 8 4.024 8c-.256 0-.511-.107-.704-.298L.29 4.694c-.426-.427-.383-1.152.13-1.515.404-.298.98-.213 1.322.15l1.13 1.108.129.022V.982C3 .427 3.447 0 3.98 0c.577 0 1.004.448 1.004.982v3.626z"
/>
</svg>
)
<svg
xmlns="http://www.w3.org/2000/svg"
width="8"
height="8"
viewBox="0 0 8 8">
<path
fill="#5D6D74"
fillRule="evenodd"
d="M4.984 4.608l1.302-1.322c.384-.384 1.024-.384 1.408 0 .384.384.384 1.024 0 1.408L4.728 7.702C4.537 7.893 4.28 8 4.024 8c-.256 0-.511-.107-.704-.298L.29 4.694c-.426-.427-.383-1.152.13-1.515.404-.298.98-.213 1.322.15l1.13 1.108.129.022V.982C3 .427 3.447 0 3.98 0c.577 0 1.004.448 1.004.982v3.626z"
/>
</svg>
);

export default icon;
24 changes: 12 additions & 12 deletions src/dataDisplay/FixedIcon/images/bullit.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react';

const icon = (
<svg
xmlns="http://www.w3.org/2000/svg"
width="6"
height="6"
viewBox="0 0 6 6">
<path
fill="#008C73"
fillRule="evenodd"
d="M3 0C1.347 0 0 1.347 0 3s1.347 3 3 3 3-1.347 3-3-1.347-3-3-3z"
/>
</svg>
)
<svg
xmlns="http://www.w3.org/2000/svg"
width="6"
height="6"
viewBox="0 0 6 6">
<path
fill="#008C73"
fillRule="evenodd"
d="M3 0C1.347 0 0 1.347 0 3s1.347 3 3 3 3-1.347 3-3-1.347-3-3-3z"
/>
</svg>
);

export default icon;
Loading