From 6b9b0e962427987265cd33fe55d82c6ecdf3639b Mon Sep 17 00:00:00 2001 From: wendesongomes Date: Thu, 22 Aug 2024 10:13:06 -0300 Subject: [PATCH 1/6] refactor: refactor style in sideBar --- .../AccountCard/AccountCard.module.scss | 19 ++++++++++++++++--- src/components/AccountCard/AccountCard.tsx | 19 ++++++++++++------- src/components/Avatar/Avatar.tsx | 2 +- .../components/Sidebar/Sidebar.module.scss | 3 +++ .../SocialAccordion.module.scss | 8 ++++++-- .../SocialAccordion/SocialAccordion.tsx | 2 +- 6 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/components/AccountCard/AccountCard.module.scss b/src/components/AccountCard/AccountCard.module.scss index f7b8760fd..38da3d656 100644 --- a/src/components/AccountCard/AccountCard.module.scss +++ b/src/components/AccountCard/AccountCard.module.scss @@ -1,5 +1,9 @@ @use '~styles/global.scss' as *; +p { + margin: 0; +} + .container { display: flex; flex-flow: row nowrap; @@ -9,7 +13,7 @@ align-items: center; justify-content: space-between; - padding: 0.8rem 0.8rem 0.8rem 1.6rem; + padding: 0.8rem; border-bottom: 0.1rem solid $primaryGray; @@ -22,9 +26,8 @@ .username { width: 100%; - overflow: hidden; - display: flex; + overflow: hidden; font-size: 1.4rem; text-overflow: ellipsis; @@ -40,13 +43,23 @@ font-size: 1.4rem; } +.containerButton { + display: flex; + gap: 0.7rem; +} + .avatar { width: 40px; height: 40px; + display: flex; + flex-shrink: 0; align-items: center; justify-content: center; + + background-color: $primaryPurple; + border-radius: 50%; } diff --git a/src/components/AccountCard/AccountCard.tsx b/src/components/AccountCard/AccountCard.tsx index 86e1c956d..825605785 100644 --- a/src/components/AccountCard/AccountCard.tsx +++ b/src/components/AccountCard/AccountCard.tsx @@ -3,6 +3,7 @@ import { ReactNode, useState } from 'react'; import classNames from 'classnames'; import { Avatar } from '~components/Avatar/Avatar'; +import Icon from '~components/Icon/Icon'; import { Switch } from '~components/Switch/Switch'; import scss from './AccountCard.module.scss'; @@ -42,13 +43,17 @@ export function AccountCard({

{username}

- + +
); } diff --git a/src/components/Avatar/Avatar.tsx b/src/components/Avatar/Avatar.tsx index 6173d0e47..be08cb62d 100644 --- a/src/components/Avatar/Avatar.tsx +++ b/src/components/Avatar/Avatar.tsx @@ -9,7 +9,7 @@ import { AvatarProps } from './Avatar.types'; export function Avatar(props: AvatarProps): ReactNode { const [firstLetter] = props.username.split(''); - if (props.image !== undefined) { + if (props.image === undefined) { return ( From 184fbcf5bc45eed6b2b1ffa76e655e2579030cb1 Mon Sep 17 00:00:00 2001 From: wendesongomes Date: Thu, 22 Aug 2024 10:34:01 -0300 Subject: [PATCH 2/6] refactor: refactor img in avatar --- src/components/Avatar/Avatar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Avatar/Avatar.tsx b/src/components/Avatar/Avatar.tsx index be08cb62d..6173d0e47 100644 --- a/src/components/Avatar/Avatar.tsx +++ b/src/components/Avatar/Avatar.tsx @@ -9,7 +9,7 @@ import { AvatarProps } from './Avatar.types'; export function Avatar(props: AvatarProps): ReactNode { const [firstLetter] = props.username.split(''); - if (props.image === undefined) { + if (props.image !== undefined) { return ( Date: Thu, 22 Aug 2024 14:01:52 -0300 Subject: [PATCH 3/6] refactor: adjust header padding --- src/components/AccordionTab/AccordionTab.module.scss | 2 +- src/components/AccountCard/AccountCard.module.scss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/AccordionTab/AccordionTab.module.scss b/src/components/AccordionTab/AccordionTab.module.scss index d1804fc21..24dff9715 100644 --- a/src/components/AccordionTab/AccordionTab.module.scss +++ b/src/components/AccordionTab/AccordionTab.module.scss @@ -55,7 +55,7 @@ font-size: 1.6rem; line-height: 1; - padding: 1.3rem 2.2rem; + padding: 2.2rem; position: relative; diff --git a/src/components/AccountCard/AccountCard.module.scss b/src/components/AccountCard/AccountCard.module.scss index 38da3d656..b4ff41739 100644 --- a/src/components/AccountCard/AccountCard.module.scss +++ b/src/components/AccountCard/AccountCard.module.scss @@ -35,6 +35,10 @@ p { white-space: nowrap; } +.star { + color: $tertiaryGray; +} + .favorite { padding: 0.6rem; } From 8169b4f501204bc6280e1dc3c4196c09189bab08 Mon Sep 17 00:00:00 2001 From: wendesongomes Date: Mon, 2 Sep 2024 11:20:40 -0300 Subject: [PATCH 4/6] fix: corrected header and accordion container --- mock-api.json | 36 ++++++++++++------- .../AccordionTab/AccordionTab.module.scss | 2 ++ .../AccountCard/AccountCard.module.scss | 8 ++--- src/components/AccountCard/AccountCard.tsx | 9 +++-- .../SocialAccordion.module.scss | 2 +- .../SocialAccordion/SocialAccordion.tsx | 4 ++- 6 files changed, 37 insertions(+), 24 deletions(-) diff --git a/mock-api.json b/mock-api.json index 84f7797df..a9dd36d47 100644 --- a/mock-api.json +++ b/mock-api.json @@ -84,7 +84,7 @@ "userName": "Discord User 1", "token": "DISCORD_EXAMPLE_TOKEN_1", "valid": true, - "avatar": "https://example.com/image1.jpg" + "avatar": "https://cdn0.iconfinder.com/data/icons/free-social-media-set/24/discord-256.png" }, { "id": "14", @@ -92,7 +92,7 @@ "userName": "Twitter User 14", "token": "TWITTER_EXAMPLE_TOKEN_14", "valid": true, - "avatar": "https://example.com/image2.jpg" + "avatar": "https://cdn2.iconfinder.com/data/icons/threads-by-instagram/24/x-logo-twitter-new-brand-contained-256.png" }, { "id": "2", @@ -100,7 +100,7 @@ "userName": "Discord User 2", "token": "DISCORD_EXAMPLE_TOKEN_2", "valid": false, - "avatar": "https://example.com/image3.jpg" + "avatar": "https://cdn0.iconfinder.com/data/icons/free-social-media-set/24/discord-256.png" }, { "id": "3", @@ -108,7 +108,7 @@ "userName": "Discord User 3", "token": "DISCORD_EXAMPLE_TOKEN_3", "valid": true, - "avatar": "https://example.com/image4.jpg" + "avatar": "https://cdn0.iconfinder.com/data/icons/free-social-media-set/24/discord-256.png" }, { "id": "4", @@ -116,7 +116,7 @@ "userName": "Twitter User 4", "token": "TWITTER_EXAMPLE_TOKEN_4", "valid": false, - "avatar": "https://example.com/image2.jpg" + "avatar": "https://cdn2.iconfinder.com/data/icons/threads-by-instagram/24/x-logo-twitter-new-brand-contained-256.png" }, { "id": "5", @@ -124,7 +124,7 @@ "userName": "Discord User 5", "token": "DISCORD_EXAMPLE_TOKEN_5", "valid": false, - "avatar": "https://example.com/image6.jpg" + "avatar": "https://cdn0.iconfinder.com/data/icons/free-social-media-set/24/discord-256.png" }, { "id": "6", @@ -132,7 +132,7 @@ "userName": "Twitter User 6", "token": "TWITTER_EXAMPLE_TOKEN_6", "valid": true, - "avatar": "https://example.com/image2.jpg" + "avatar": "https://cdn2.iconfinder.com/data/icons/threads-by-instagram/24/x-logo-twitter-new-brand-contained-256.png" } ], "social-medias": [ @@ -153,7 +153,9 @@ "maxFileSize": 20000000, "maxWidth": 700, "maxHeight": 600, - "ar": ["4:3"], + "ar": [ + "4:3" + ], "maxDuration": 1000 } }, @@ -177,7 +179,9 @@ "maxSize": 10000, "maxWidth": 900, "maxHeight": 700, - "ar": ["16:9"], + "ar": [ + "16:9" + ], "maxDuration": 1100 } }, @@ -201,7 +205,9 @@ "maxSize": 30000, "maxWidth": 1920, "maxHeight": 1080, - "ar": ["5:3"], + "ar": [ + "5:3" + ], "maxDuration": 5000 } }, @@ -232,7 +238,9 @@ "maxSize": 10000, "maxWidth": 700, "maxHeight": 600, - "ar": ["16:9"], + "ar": [ + "16:9" + ], "maxDuration": 500 } }, @@ -256,7 +264,9 @@ "maxSize": 20000, "maxWidth": 700, "maxHeight": 600, - "ar": ["4:3"], + "ar": [ + "4:3" + ], "maxDuration": 1000 } }, @@ -436,4 +446,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/src/components/AccordionTab/AccordionTab.module.scss b/src/components/AccordionTab/AccordionTab.module.scss index 24dff9715..1622ddd93 100644 --- a/src/components/AccordionTab/AccordionTab.module.scss +++ b/src/components/AccordionTab/AccordionTab.module.scss @@ -7,6 +7,8 @@ .headerTitle { flex-grow: 1; + + margin: 0; } .headerIcon { diff --git a/src/components/AccountCard/AccountCard.module.scss b/src/components/AccountCard/AccountCard.module.scss index b4ff41739..463c6c534 100644 --- a/src/components/AccountCard/AccountCard.module.scss +++ b/src/components/AccountCard/AccountCard.module.scss @@ -1,6 +1,6 @@ @use '~styles/global.scss' as *; -p { +.username { margin: 0; } @@ -35,10 +35,6 @@ p { white-space: nowrap; } -.star { - color: $tertiaryGray; -} - .favorite { padding: 0.6rem; } @@ -49,7 +45,7 @@ p { .containerButton { display: flex; - gap: 0.7rem; + gap: 0.9rem; } .avatar { diff --git a/src/components/AccountCard/AccountCard.tsx b/src/components/AccountCard/AccountCard.tsx index 825605785..416aa6bdf 100644 --- a/src/components/AccountCard/AccountCard.tsx +++ b/src/components/AccountCard/AccountCard.tsx @@ -3,6 +3,7 @@ import { ReactNode, useState } from 'react'; import classNames from 'classnames'; import { Avatar } from '~components/Avatar/Avatar'; +import Button from '~components/Button/Button'; import Icon from '~components/Icon/Icon'; import { Switch } from '~components/Switch/Switch'; @@ -44,9 +45,11 @@ export function AccountCard({

{username}

- +