Skip to content

Commit

Permalink
Fix glitch-soc CW media icons
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire committed Jan 13, 2024
1 parent 46128f2 commit 6333900
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 15 additions & 0 deletions app/javascript/flavours/glitch/components/status_content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import { withRouter } from 'react-router-dom';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';

import { ReactComponent as ImageIcon } from '@material-symbols/svg-600/outlined/image.svg';
import { ReactComponent as InsertChartIcon } from '@material-symbols/svg-600/outlined/insert_chart.svg';
import { ReactComponent as LinkIcon } from '@material-symbols/svg-600/outlined/link.svg';
import { ReactComponent as MovieIcon } from '@material-symbols/svg-600/outlined/movie.svg';
import { ReactComponent as MusicNoteIcon } from '@material-symbols/svg-600/outlined/music_note.svg';

import { Icon } from 'flavours/glitch/components/icon';
import { autoPlayGif, languages as preloadedLanguages } from 'flavours/glitch/initial_state';
import { decode as decodeIDNA } from 'flavours/glitch/utils/idna';
Expand Down Expand Up @@ -381,12 +387,21 @@ class StatusContent extends PureComponent {
/>,
];
if (mediaIcons) {
const mediaComponents = {
'link': LinkIcon,
'picture-o': ImageIcon,
'tasks': InsertChartIcon,
'video-camera': MovieIcon,
'music': MusicNoteIcon,
};

mediaIcons.forEach((mediaIcon, idx) => {
toggleText.push(
<Icon
fixedWidth
className='status__content__spoiler-icon'
id={mediaIcon}
icon={mediaComponents[mediaIcon]}
aria-hidden='true'
key={`icon-${idx}`}
/>,
Expand Down
4 changes: 1 addition & 3 deletions app/javascript/flavours/glitch/styles/components/status.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
}

.status__content__spoiler-link {
display: inline-block;
display: inline-flex;
border-radius: 2px;
background: lighten($ui-base-color, 30%);
border: 0;
Expand All @@ -160,8 +160,6 @@
border-inline-start: 1px solid currentColor;
padding: 0;
padding-inline-start: 4px;
font-size: 16px;
vertical-align: -2px;
}
}

Expand Down

0 comments on commit 6333900

Please sign in to comment.