Skip to content

Commit 7138265

Browse files
committed
React Dashboard Guide add Social links to landing
1 parent 8ec4b4a commit 7138265

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

Diff for: guides/react-dashboard/src/components/Hero/Hero.jsx

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import theme, { sharedStyles } from '../../theme';
66
import DashboardImg from './dashboard-sample.png';
77
import browserControls from './browser-controls.svg';
88
import cover from './react-dashboard-cover.jpg';
9+
import Social from "../Social/Social";
910

1011
const Container = styled.div`
1112
background-color: ${theme.colors.lightBlue};
@@ -115,6 +116,7 @@ const SecondaryButton = styled.a`
115116
const ButtonsContainer = styled.div`
116117
display: flex;
117118
margin-top: 45px;
119+
margin-bottom: 25px;
118120
justify-content: space-between;
119121
flex-wrap: wrap;
120122
${media.lessThan("small")`
@@ -137,6 +139,7 @@ const Hero = ({ startUrl }) => (
137139
<PrimaryButton to={startUrl}>Start Learning</PrimaryButton>
138140
<SecondaryButton href="https://react-dashboard-demo.cube.dev">Demo</SecondaryButton>
139141
</ButtonsContainer>
142+
<Social align="flex-start" />
140143
</CopyContainer>
141144
<MediaContainer>
142145
<video muted autoPlay playsInline loop preload="auto" poster={cover}>

Diff for: guides/react-dashboard/src/components/Social/Social.jsx

+15-5
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,30 @@ import {
1313
import styled from 'styled-components'
1414
import config from "../../../data/SiteConfig";
1515
import theme from '../../theme';
16+
import media from "styled-media-query";
1617

1718
const Container = styled.div`
1819
margin-top: 20px;
1920
display: flex;
20-
justify-content: center;
21+
justify-content: ${props => props.align};
22+
${media.lessThan("medium")`
23+
justify-content: center;
24+
`}
2125
2226
& > div {
2327
cursor: pointer;
2428
margin: 0 15px;
29+
&:first-child {
30+
margin-left: 0;
31+
}
2532
}
2633
`
2734

28-
const Social = ({ path, title, iconSize }) => {
35+
const Social = ({ path, title, iconSize, align }) => {
2936
const url = urljoin(config.siteUrl, config.pathPrefix, path);
30-
const fullTitle = `${config.siteTitle}: ${title}`
37+
const fullTitle = [config.siteTitle, title].filter(v => !!v).join(": ")
3138
return (
32-
<Container>
39+
<Container align={align}>
3340
<RedditShareButton url={url} title={fullTitle}>
3441
<RedditIcon round size={iconSize} />
3542
</RedditShareButton>
@@ -44,7 +51,10 @@ const Social = ({ path, title, iconSize }) => {
4451
}
4552

4653
Social.defaultProps = {
47-
iconSize: 40
54+
iconSize: 40,
55+
title: undefined,
56+
path: "",
57+
align: "center"
4858
}
4959

5060
export default Social;

0 commit comments

Comments
 (0)