Updated all basic components
removed unnecessary components, combined where necessary added each component to a folder, added individual css style modules optimized some component rendering flows removed functional components in favor of pure components linted and formatted all of the files
This commit is contained in:
27
app/javascript/gabsocial/components/display_name/index.js
Normal file
27
app/javascript/gabsocial/components/display_name/index.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import VerifiedIcon from '../verified_icon';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
export default class DisplayName extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
account: ImmutablePropTypes.map.isRequired,
|
||||
};
|
||||
|
||||
render () {
|
||||
const { account } = this.props;
|
||||
|
||||
return (
|
||||
<span className='display-name'>
|
||||
<bdi>
|
||||
<strong className='display-name__html' dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} />
|
||||
</bdi>
|
||||
{account.get('is_verified') && <VerifiedIcon />}
|
||||
<span className='display-name__account'>@{account.get('acct')}</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
15
app/javascript/gabsocial/components/display_name/index.scss
Normal file
15
app/javascript/gabsocial/components/display_name/index.scss
Normal file
@@ -0,0 +1,15 @@
|
||||
.display-name {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
|
||||
@include text-overflow(break-word);
|
||||
|
||||
&__html {
|
||||
font-weight: 600;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
&__account {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user