Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 7b2696c

Browse files
committed
fix(client): change twitter icon color
1 parent 573e546 commit 7b2696c

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

packages/client/assets/style/root.css

-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
@import './variables.css';
55
@import './tags.css';
66
@import './typography.css';
7-
@import './sidebar.css';
87
@import './grid.css';
98
@import './customize.css';

packages/client/src/components/Sidebar.js

+17-19
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,31 @@ import { slide as Menu } from 'react-burger-menu';
33
import screenfull from 'screenfull';
44
import { FaTwitter, FaGithub } from 'react-icons/fa';
55
import { MdFirstPage, MdLastPage, MdFullscreen, MdAirplay } from 'react-icons/md';
6+
import '../../assets/style/sidebar.css';
67

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

13+
const A = ({ href, areaLabel, children }) => (
14+
<a key="twitter" rel="noopener noreferrer" target="_blank" href={href} aria-label={areaLabel}>
15+
{children}
16+
</a>
17+
);
18+
1319
export const Sidebar = memo(
1420
({ isOpen, onStateChange, goTo, currentIndex, runPresentationMode, contents, totalSlides }) => (
1521
<Menu isOpen={isOpen} disableAutoFocus onStateChange={onStateChange} outerContainerId="root">
1622
<div className="sidebar-social">
17-
{Array.isArray(sns) &&
18-
sns.map((s) => {
19-
if (s === 'twitter') {
20-
return (
21-
<a
22-
key="twitter"
23-
rel="noopener noreferrer"
24-
target="_blank"
25-
href={`https://twitter.com/intent/tweet?text=${title} ${url}`}
26-
aria-label={`${title} ${url}`}
27-
>
28-
<FaTwitter />
29-
</a>
30-
);
31-
}
32-
})}
23+
{process.env.HAS_TWITTER && (
24+
<A
25+
href={`https://twitter.com/intent/tweet?text=${title} ${url}`}
26+
areaLabel={`${title} ${url}`}
27+
>
28+
<FaTwitter style={{ color: '#f5f5f5' }} />
29+
</A>
30+
)}
3331
</div>
3432
<div className="sidebar-control">
3533
<MdFirstPage onClick={() => goTo(0)} className="sidebar-cursor" />
@@ -50,9 +48,9 @@ export const Sidebar = memo(
5048
className="sidebar-cursor"
5149
/>
5250
{remoteOriginUrl && (
53-
<a href={remoteOriginUrl} target="_blank" rel="noopener noreferrer" aria-label="github">
51+
<A href={remoteOriginUrl} areaLabel="github">
5452
<FaGithub style={{ width: 20, height: 20, marginTop: 3, color: '#f5f5f5' }} />
55-
</a>
53+
</A>
5654
)}
5755
</div>
5856
{contents.length !== 0 && (

packages/fusuma/src/webpack/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ module.exports = (
136136
CSS_PATH: JSON.stringify(join(basePath, cssPath || '')),
137137
SLIDE_PATH: JSON.stringify(join(basePath, 'slides')),
138138
URL: JSON.stringify(url),
139-
SNS: JSON.stringify(sns),
139+
HAS_TWITTER: JSON.stringify(sns.includes('twitter')),
140140
TITLE: JSON.stringify(title || 'slide'),
141141
BASE_PATH: JSON.stringify(basePath),
142142
REMOTE_ORIGIN_URL: JSON.stringify(remoteOrigin),

0 commit comments

Comments
 (0)