Skip to content

Commit b5a6722

Browse files
92 adjusted the company logo sizing (#99)
1 parent bf53560 commit b5a6722

File tree

3 files changed

+21
-31
lines changed

3 files changed

+21
-31
lines changed

components/company-logo/index.js

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,21 @@ const SIZE = Object.freeze({
1010
large: 'large',
1111
})
1212

13-
const getSize = (variant) => {
14-
switch (variant) {
15-
case SIZE.large:
16-
return '256px'
17-
case SIZE.small:
18-
return '220px'
19-
default:
20-
return '256px'
21-
}
22-
}
13+
const SIZE_PERCENT = Object.freeze({
14+
small: 25,
15+
large: 33,
16+
})
17+
18+
const getSize = (variant) => SIZE_PERCENT[variant] ?? SIZE_PERCENT.large
2319

2420
const Anchor = styled.a`
2521
display: flex;
2622
justify-content: center;
2723
align-items: center;
28-
`
29-
30-
const StyledImg = styled.img`
31-
padding: 24px;
24+
flex-grow: ${(props) => getSize(props.size) / 100};
25+
max-width: ${(props) => getSize(props.size)}%;
3226
min-width: 180px;
33-
width: 30%;
34-
max-width: ${(props) => getSize(props.size)};
35-
margin: 24px 0px;
36-
opacity: 0.5;
37-
:hover {
38-
opacity: 0.75;
39-
}
27+
padding: 36px;
4028
4129
@media only screen and (max-width: ${DESKTOP_SIZE}) {
4230
margin: 0;
@@ -54,9 +42,17 @@ const StyledImg = styled.img`
5442
}
5543
`
5644

45+
const StyledImg = styled.img`
46+
max-width: 100%;
47+
opacity: 0.5;
48+
:hover {
49+
opacity: 0.75;
50+
}
51+
`
52+
5753
const CompanyLogo = ({ url, logoSrc, alt, size }) => (
58-
<Anchor href={url} rel="noopener noreferrer">
59-
<StyledImg alt={alt} src={logoSrc} size={size} />
54+
<Anchor href={url} rel="noopener noreferrer" size={size}>
55+
<StyledImg alt={alt} src={logoSrc} />
6056
</Anchor>
6157
)
6258

pages/about.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
CompanyLogo,
3-
Heading,
4-
Text,
5-
Footer,
6-
SiteHeader,
7-
} from 'components'
1+
import { CompanyLogo, Heading, Text, Footer, SiteHeader } from 'components'
82
import { ExecutiveTeamSection, LogoSection } from 'sections'
93
import styles from 'styles/about.module.css'
104

styles/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export const DESKTOP_SIZE = '1023px'
22
export const TABLET_SIZE = '767px'
3-
export const COMPACT_SIZE = '575px'
43
export const MOBILE_SIZE = '413px'
4+
export const COMPACT_SIZE = '575px'

0 commit comments

Comments
 (0)