Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit a45b27d

Browse files
SuthesanSuthesan
Suthesan
authored and
Suthesan
committed
fix code smell
1 parent 2086d40 commit a45b27d

File tree

6 files changed

+47
-24
lines changed

6 files changed

+47
-24
lines changed

src/components/localization/language-dropdown.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@ const Arrow = styled(Chevron)`
4646
const Absolute = styled.div`
4747
position: absolute;
4848
z-index: -1;
49-
top: ${(props) => (props.is_high_nav ? '4.8rem' : props.security ? '10.5rem' : '5.5rem')};
49+
top: ${(props) => {
50+
if (props.is_high_nav) {
51+
return '4.8rem'
52+
} else if (props.security) {
53+
return '10.5rem'
54+
} else {
55+
return '5.5rem'
56+
}
57+
}};
5058
left: -22rem;
5159
height: auto;
5260
background-color: var(--color-white);
@@ -61,7 +69,7 @@ const Absolute = styled.div`
6169
left: 0;
6270
}
6371
`
64-
72+
/* stylelint-disable */
6573
const FadeInDown = keyframes`
6674
from {
6775
opacity:0;
@@ -78,6 +86,7 @@ const FadeOutUp = keyframes`
7886
opacity:0;
7987
}
8088
`
89+
8190
const ItemContainer = styled.div`
8291
background-color: var(--color-white);
8392
padding: 1.6rem 0.8rem;
@@ -130,6 +139,7 @@ const ResponsiveText = styled(Text)`
130139
display: none;
131140
}
132141
`
142+
/* stylelint-enable */
133143

134144
const query = graphql`
135145
query {

src/pages/bug-bounty/_scope.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ const Scope = () => {
6363
{localize(list.description)}
6464
</Header>
6565

66-
{list.check_list.map((item, idx) => {
66+
{list.check_list.map((item, index) => {
6767
return (
6868
<Flex
6969
height="auto"
7070
mt="1.6rem"
7171
ai="flex-start"
7272
jc="flex-start"
73-
key={idx}
73+
key={index}
7474
>
7575
<IconWrap src={tick_icon ? TickIcon : XIcon} />
7676
<div>

src/pages/bug-bounty/_submit_a_bug_report.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ReactElement } from 'react'
1+
import React from 'react'
22
import styled from 'styled-components'
33
import { graphql, useStaticQuery } from 'gatsby'
44
import { Container, SectionContainer, Flex } from 'components/containers'

src/pages/bug-bounty/vulnerabilities-types/index.tsx

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { vulnerability_types_content } from '../static/_vulnerabilities-types-co
55
import { localize, WithIntl, Localize } from 'components/localization'
66
import Layout from 'components/layout/layout'
77
import { Container, Flex, SEO } from 'components/containers'
8-
import { Header, Text } from 'components/elements'
8+
import { Header } from 'components/elements'
99
import device from 'themes/device'
1010

1111
interface CardItemProps {
@@ -102,19 +102,28 @@ const VulnerabilitiesTypes = () => {
102102
</Header>
103103
</CardItem>
104104
) : (
105-
item.profit_table.map((item, idx) => {
106-
return (
107-
<CardItem second_item={idx === 1} key={idx}>
108-
<Header type="small" weight="normal">
109-
<Localize translate_text={item.title} />
110-
</Header>
111-
112-
<Header type="paragraph-2" mt="4px">
113-
{item.content}
114-
</Header>
115-
</CardItem>
116-
)
117-
})
105+
item.profit_table.map(
106+
(profit_table_item, profit_table_idx) => {
107+
return (
108+
<CardItem
109+
second_item={profit_table_idx === 1}
110+
key={profit_table_idx}
111+
>
112+
<Header type="small" weight="normal">
113+
<Localize
114+
translate_text={
115+
profit_table_item.title
116+
}
117+
/>
118+
</Header>
119+
120+
<Header type="paragraph-2" mt="4px">
121+
{profit_table_item.content}
122+
</Header>
123+
</CardItem>
124+
)
125+
},
126+
)
118127
)}
119128
</CardWrap>
120129

@@ -129,8 +138,12 @@ const VulnerabilitiesTypes = () => {
129138
</Header>
130139

131140
<StyledUl>
132-
{item.examples.map((item, idx) => {
133-
return <StyledLi key={idx}>{localize(item)}</StyledLi>
141+
{item.examples.map((example_item, example_idx) => {
142+
return (
143+
<StyledLi key={example_idx}>
144+
{localize(example_item)}
145+
</StyledLi>
146+
)
134147
})}
135148
</StyledUl>
136149
</React.Fragment>

src/pages/careers/besquare/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ReactElement } from 'react'
1+
import React from 'react'
22
import Advantages from './components/sections/_advantages'
33
import ApplicationProcess from './components/sections/_application-process'
44
import Description from './components/sections/_description'

src/pages/terms-and-conditions/_business-grid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Col.propTypes = {
3636
url: PropTypes.string,
3737
}
3838

39-
const IconGrid = () => (
39+
const BusinessGrid = () => (
4040
<StyledContainer>
4141
<StyledGrid
4242
columns="repeat(3, 1fr)"
@@ -87,4 +87,4 @@ const IconGrid = () => (
8787
</StyledContainer>
8888
)
8989

90-
export default IconGrid
90+
export default BusinessGrid

0 commit comments

Comments
 (0)