forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change design of role badges in web UI (mastodon#26281)
Co-authored-by: Claire <[email protected]>
- Loading branch information
1 parent
01f0cff
commit 2cbdff9
Showing
7 changed files
with
491 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { ReactComponent as GroupsIcon } from '@material-design-icons/svg/outlined/group.svg'; | ||
import { ReactComponent as PersonIcon } from '@material-design-icons/svg/outlined/person.svg'; | ||
import { ReactComponent as SmartToyIcon } from '@material-design-icons/svg/outlined/smart_toy.svg'; | ||
|
||
|
||
export const Badge = ({ icon, label, domain }) => ( | ||
<div className='account-role'> | ||
{icon} | ||
{label} | ||
{domain && <span className='account-role__domain'>{domain}</span>} | ||
</div> | ||
); | ||
|
||
Badge.propTypes = { | ||
icon: PropTypes.node, | ||
label: PropTypes.node, | ||
domain: PropTypes.node, | ||
}; | ||
|
||
Badge.defaultProps = { | ||
icon: <PersonIcon />, | ||
}; | ||
|
||
export const GroupBadge = () => ( | ||
<Badge icon={<GroupsIcon />} label={<FormattedMessage id='account.badges.group' defaultMessage='Group' />} /> | ||
); | ||
|
||
export const AutomatedBadge = () => ( | ||
<Badge icon={<SmartToyIcon />} label={<FormattedMessage id='account.badges.bot' defaultMessage='Automated' />} /> | ||
); |
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
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,13 @@ | ||
module.exports = { | ||
test: /\.svg$/, | ||
include: /node_modules\/@material-design-icons/, | ||
issuer: /\.[jt]sx?$/, | ||
use: [ | ||
{ | ||
loader: '@svgr/webpack', | ||
options: { | ||
svgo: false, | ||
}, | ||
}, | ||
], | ||
}; |
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
Oops, something went wrong.