File tree Expand file tree Collapse file tree 1 file changed +44
-29
lines changed Expand file tree Collapse file tree 1 file changed +44
-29
lines changed Original file line number Diff line number Diff line change 1
1
// Libraries
2
2
import React from "react"
3
- import styled from "@emotion/styled"
3
+ import { Flex , Box , Icon } from "@chakra-ui/react"
4
+ import {
5
+ FaTwitter ,
6
+ FaYoutube ,
7
+ FaDiscord ,
8
+ FaRedditAlien ,
9
+ FaStackExchange ,
10
+ FaGlobe ,
11
+ } from "react-icons/fa"
4
12
5
- // Components
6
- import Icon from "./Icon"
7
-
8
- // Styles
9
- const Item = styled . div `
10
- display: flex;
11
- width: 100%;
12
- padding: 0.5rem 0;
13
- align-items: center;
14
- `
15
-
16
- const StyledIcon = styled ( Icon ) `
17
- padding-right: 0.75rem;
18
- `
19
-
20
- const ChildrenContainer = styled . div `
21
- font-style: italic;
13
+ const socialColors = {
14
+ reddit : "#ff4301" ,
15
+ twitter : "#1da1f2" ,
16
+ youtube : "#ff0000" ,
17
+ discord : "#7289da" ,
18
+ stackExchange : "#48a2da" ,
19
+ }
22
20
23
- > a {
24
- font-style: normal;
25
- }
26
- `
21
+ const icons = {
22
+ reddit : FaRedditAlien ,
23
+ twitter : FaTwitter ,
24
+ youtube : FaYoutube ,
25
+ discord : FaDiscord ,
26
+ stackExchange : FaStackExchange ,
27
+ webpage : FaGlobe ,
28
+ }
27
29
28
30
export interface IProps {
29
31
children ?: React . ReactNode
30
- socialIcon : string
32
+ socialIcon : keyof typeof icons
31
33
}
34
+
32
35
const SocialListItem : React . FC < IProps > = ( { children, socialIcon } ) => {
33
36
return (
34
- < Item >
35
- < div >
36
- < StyledIcon name = { socialIcon } size = { "2.5rem" } color = { true } />
37
- </ div >
38
- < ChildrenContainer > { children } </ ChildrenContainer >
39
- </ Item >
37
+ < Flex w = "100%" py = "2" px = "0" align = "center" >
38
+ < Icon
39
+ as = { icons [ socialIcon ] }
40
+ pr = { 3 }
41
+ boxSize = { 10 }
42
+ color = { socialColors [ socialIcon ] }
43
+ />
44
+ < Box
45
+ fontStyle = "italic"
46
+ sx = { {
47
+ "> a" : {
48
+ fontStyle : "normal" ,
49
+ } ,
50
+ } }
51
+ >
52
+ { children }
53
+ </ Box >
54
+ </ Flex >
40
55
)
41
56
}
42
57
You can’t perform that action at this time.
0 commit comments