Skip to content

Commit

Permalink
Merge pull request #469 from cloudnativedaysjp/feat/replace_twitter_w…
Browse files Browse the repository at this point in the history
…ith_x

twitterをXに置き換え
  • Loading branch information
jacopen authored Nov 5, 2023
2 parents cc22b61 + 3a717f5 commit 5097f53
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 24 deletions.
Binary file removed public/cndt2023/ui/twitter_logo.png
Binary file not shown.
Binary file added public/cndt2023/ui/x_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 7 additions & 10 deletions src/components/TalkInfo/TalkInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export const PTalkInfo: React.FC<Props> = ({
selectedTalk,
selectedTrack,
}) => {
const twitterURL = (trackName?: string) => {
const base = `http://twitter.com/share?url=https://event.cloudnativedays.jp/${eventAbbr}&related=@cloudnativedays&hashtags=${eventAbbr}`
const xURL = (trackName?: string) => {
const base = `http://x.com/share?url=https://event.cloudnativedays.jp/${eventAbbr}&related=@cloudnativedays&hashtags=${eventAbbr}`
if (!trackName) return base
return base + '_' + trackName
}
Expand Down Expand Up @@ -68,14 +68,11 @@ export const PTalkInfo: React.FC<Props> = ({
一緒に盛り上がろう
</Styled.SocialHeader>
<Styled.ButtonContainer>
<Styled.ButtonLink
href={twitterURL(selectedTrack?.name)}
target="_blank"
>
<Styled.TweetButton>
<Styled.TwitterImg src={`/${eventAbbr}/ui/twitter_logo.png`} />
{`tweet #${eventAbbr}_${selectedTrack?.name}`}
</Styled.TweetButton>
<Styled.ButtonLink href={xURL(selectedTrack?.name)} target="_blank">
<Styled.XPostButton>
<Styled.XImg src={`/${eventAbbr}/ui/x_logo.png`} />
{`ポスト #${eventAbbr}_${selectedTrack?.name}`}
</Styled.XPostButton>
</Styled.ButtonLink>
</Styled.ButtonContainer>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ exports[`PTalkInfo should render when props undefined 1`] = `
>
<a
class="styled__ButtonLink-sc-15n5q1r-10 gvQFDk"
href="http://twitter.com/share?url=https://event.cloudnativedays.jp/cndt2022&related=@cloudnativedays&hashtags=cndt2022"
href="http://x.com/share?url=https://event.cloudnativedays.jp/cndt2022&related=@cloudnativedays&hashtags=cndt2022"
target="_blank"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text styled__TweetButton-sc-15n5q1r-13 hUErgO"
class="MuiButtonBase-root MuiButton-root MuiButton-text styled__XPostButton-sc-15n5q1r-13 jgXyFc"
tabindex="0"
type="button"
>
<span
class="MuiButton-label"
>
<img
class="styled__TwitterImg-sc-15n5q1r-14 yAEEI"
src="/cndt2022/ui/twitter_logo.png"
class="styled__XImg-sc-15n5q1r-14 bFvaWF"
src="/cndt2022/ui/x_logo.png"
/>
tweet #cndt2022_undefined
ポスト #cndt2022_undefined
</span>
<span
class="MuiTouchRipple-root"
Expand Down Expand Up @@ -96,22 +96,22 @@ exports[`PTalkInfo should render without crash 1`] = `
>
<a
class="styled__ButtonLink-sc-15n5q1r-10 gvQFDk"
href="http://twitter.com/share?url=https://event.cloudnativedays.jp/cndt2022&related=@cloudnativedays&hashtags=cndt2022_A"
href="http://x.com/share?url=https://event.cloudnativedays.jp/cndt2022&related=@cloudnativedays&hashtags=cndt2022_A"
target="_blank"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text styled__TweetButton-sc-15n5q1r-13 hUErgO"
class="MuiButtonBase-root MuiButton-root MuiButton-text styled__XPostButton-sc-15n5q1r-13 jgXyFc"
tabindex="0"
type="button"
>
<span
class="MuiButton-label"
>
<img
class="styled__TwitterImg-sc-15n5q1r-14 yAEEI"
src="/cndt2022/ui/twitter_logo.png"
class="styled__XImg-sc-15n5q1r-14 bFvaWF"
src="/cndt2022/ui/x_logo.png"
/>
tweet #cndt2022_A
ポスト #cndt2022_A
</span>
<span
class="MuiTouchRipple-root"
Expand Down
8 changes: 4 additions & 4 deletions src/components/TalkInfo/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,19 @@ export const OViceImg = styled.img`
padding-right: 5px;
`

export const TweetButton = styled(Button)`
export const XPostButton = styled(Button)`
display: flex;
align-items: center;
font-size: 16px;
padding-right: 10px;
color: #ffffff;
background-color: #1da1f2;
background-color: #000000;
&:hover {
background-color: #4cb7f4;
background-color: #808080;
}
`

export const TwitterImg = styled.img`
export const XImg = styled.img`
height: 1.4em;
padding: 1.5px;
vertical-align: middle;
Expand Down

0 comments on commit 5097f53

Please sign in to comment.