Skip to content

Commit

Permalink
fix(client): change twitter icon color
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy committed Feb 6, 2021
1 parent 573e546 commit 7b2696c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
1 change: 0 additions & 1 deletion packages/client/assets/style/root.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
@import './variables.css';
@import './tags.css';
@import './typography.css';
@import './sidebar.css';
@import './grid.css';
@import './customize.css';
36 changes: 17 additions & 19 deletions packages/client/src/components/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,31 @@ import { slide as Menu } from 'react-burger-menu';
import screenfull from 'screenfull';
import { FaTwitter, FaGithub } from 'react-icons/fa';
import { MdFirstPage, MdLastPage, MdFullscreen, MdAirplay } from 'react-icons/md';
import '../../assets/style/sidebar.css';

const remoteOriginUrl = process.env.REMOTE_ORIGIN_URL;
const url = process.env.URL || window.location.href.split('#')[0];
const sns = process.env.SNS;
const title = process.env.TITLE;
const formatStr = (num) => `${num}`.padStart(2, '0');

const A = ({ href, areaLabel, children }) => (
<a key="twitter" rel="noopener noreferrer" target="_blank" href={href} aria-label={areaLabel}>
{children}
</a>
);

export const Sidebar = memo(
({ isOpen, onStateChange, goTo, currentIndex, runPresentationMode, contents, totalSlides }) => (
<Menu isOpen={isOpen} disableAutoFocus onStateChange={onStateChange} outerContainerId="root">
<div className="sidebar-social">
{Array.isArray(sns) &&
sns.map((s) => {
if (s === 'twitter') {
return (
<a
key="twitter"
rel="noopener noreferrer"
target="_blank"
href={`https://twitter.com/intent/tweet?text=${title} ${url}`}
aria-label={`${title} ${url}`}
>
<FaTwitter />
</a>
);
}
})}
{process.env.HAS_TWITTER && (
<A
href={`https://twitter.com/intent/tweet?text=${title} ${url}`}
areaLabel={`${title} ${url}`}
>
<FaTwitter style={{ color: '#f5f5f5' }} />
</A>
)}
</div>
<div className="sidebar-control">
<MdFirstPage onClick={() => goTo(0)} className="sidebar-cursor" />
Expand All @@ -50,9 +48,9 @@ export const Sidebar = memo(
className="sidebar-cursor"
/>
{remoteOriginUrl && (
<a href={remoteOriginUrl} target="_blank" rel="noopener noreferrer" aria-label="github">
<A href={remoteOriginUrl} areaLabel="github">
<FaGithub style={{ width: 20, height: 20, marginTop: 3, color: '#f5f5f5' }} />
</a>
</A>
)}
</div>
{contents.length !== 0 && (
Expand Down
2 changes: 1 addition & 1 deletion packages/fusuma/src/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module.exports = (
CSS_PATH: JSON.stringify(join(basePath, cssPath || '')),
SLIDE_PATH: JSON.stringify(join(basePath, 'slides')),
URL: JSON.stringify(url),
SNS: JSON.stringify(sns),
HAS_TWITTER: JSON.stringify(sns.includes('twitter')),
TITLE: JSON.stringify(title || 'slide'),
BASE_PATH: JSON.stringify(basePath),
REMOTE_ORIGIN_URL: JSON.stringify(remoteOrigin),
Expand Down

0 comments on commit 7b2696c

Please sign in to comment.