-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use wordmark instead of logo inside the modal (#146)
- Loading branch information
Showing
6 changed files
with
62 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { withTheme } from 'styled-components'; | ||
import Styled from './Wordmark.styles'; | ||
|
||
import { systemPropTypes } from '../../ui-kit'; | ||
|
||
function Wordmark({ size, source }) { | ||
|
||
return ( | ||
<Styled.Image src={source || './icon.png'} alt="Logo" size={size} /> | ||
); | ||
} | ||
|
||
Wordmark.propTypes = { | ||
...systemPropTypes, | ||
size: PropTypes.number, | ||
source: PropTypes.string, | ||
}; | ||
|
||
export default withTheme(Wordmark); |
24 changes: 24 additions & 0 deletions
24
packages/web-shared/components/Wordmark/Wordmark.styles.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { withTheme } from 'styled-components'; | ||
import styled, { css } from 'styled-components';; | ||
|
||
const DEFAULT_ICON_SIZE = '80px'; | ||
|
||
const imageStyles = ({ size }) => { | ||
const newSize = size || DEFAULT_ICON_SIZE; | ||
|
||
return css` | ||
max-height: ${newSize}; | ||
max-width: 80%; | ||
`; | ||
}; | ||
|
||
const Image = withTheme(styled.img` | ||
resizemode: 'contain'; | ||
${imageStyles}; | ||
`); | ||
|
||
const Styled = { | ||
Image, | ||
}; | ||
|
||
export default Styled; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Wordmark from './Wordmark'; | ||
|
||
export default Wordmark; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ export const GET_CURRENT_CHURCH = gql` | |
slug | ||
theme | ||
logo | ||
wordmarkLightUrl | ||
} | ||
} | ||
`; | ||
|