1- import React , { useState , useEffect } from "react"
1+ import React from "react"
22import { useStaticQuery , graphql } from "gatsby"
33import styled from "styled-components"
44import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
55import { faDownload } from "@fortawesome/free-solid-svg-icons"
66import { faLinux , faApple , faWindows } from "@fortawesome/free-brands-svg-icons"
7-
87import Layout from "../components/layout"
9- import SEO from "../components/seo"
8+ import Seo from "../components/seo"
109import Container from "../components/container"
1110import Banner from "../components/banner"
1211import SiteSpecificVersions from "../components/SiteSpecificVersions"
13-
1412import { dlInfo } from "../utils/downloadinfo"
1513
1614const Flex = styled . div `
@@ -25,43 +23,6 @@ const Flex = styled.div`
2523 }
2624`
2725
28- const OSButtons = styled . div `
29- margin: 0 0 1rem;
30- button {
31- background-color: #ffffff;
32- border: none;
33- cursor: pointer;
34- margin: 0 1rem 1rem;
35- }
36-
37- button:hover {
38- color: #00293f;
39- }
40-
41- .osLinux {
42- color: ${ props =>
43- props . OSName === "Linux" || props . OSName === "Other"
44- ? "#004160"
45- : "#000000" } ;
46- border-bottom: ${ props =>
47- props . OSName === "Linux" || props . OSName === "Other"
48- ? "2px solid #004160"
49- : "none" } ;
50- }
51-
52- .osMac {
53- color: ${ props => ( props . OSName === "Mac" ? "#004160" : "#000000" ) } ;
54- border-bottom: ${ props =>
55- props . OSName === "Mac" ? "2px solid #004160" : "none" } ;
56- }
57-
58- .osWindows {
59- color: ${ props => ( props . OSName === "Windows" ? "#004160" : "#000000" ) } ;
60- border-bottom: ${ props =>
61- props . OSName === "Windows" ? "2px solid #004160" : "none" } ;
62- }
63- `
64-
6526const StyledDownloadButton = styled . a `
6627 text-decoration: none;
6728 background-color: #004160;
@@ -84,51 +45,32 @@ const StyledDownloadButton = styled.a`
8445 }
8546`
8647
87- const StyledDownloadButtonDev = styled ( StyledDownloadButton ) `
88- background-color: #ffffff;
89- color: #004160;
90-
91- &:hover {
92- color: #ffffff;
93- background-color: #004160;
94- border: 2px solid #004160;
95- }
48+ const DownloadSubtext = styled . p `
49+ text-align: center;
50+ font-size: 0.95rem;
51+ padding: 0.835rem 0.935rem;
9652`
9753
98- const DownloadSubtext = styled . p `
54+ const DownloadText = styled . p `
9955 text-align: center;
100- font-size: 0.85rem ;
56+ font-size: 1.1rem ;
10157 padding: 0.835rem 0.935rem;
58+ margin-top: 0.5rem;
59+ margin-bottom: 2rem;
10260`
10361
104- const DownloadButton = ( { link , os } ) => (
62+ const DownloadButtonPhoebus = ( ) => (
10563 < div >
106- < StyledDownloadButton href = { link } >
107- < FontAwesomeIcon icon = { faDownload } /> Download Control System Studio
64+ < StyledDownloadButton href = { dlInfo . downloadGitRelease } target = { "_blank" } >
65+ < FontAwesomeIcon icon = { faDownload } /> Download Phoebus Control System Studio
10866 </ StyledDownloadButton >
10967 < DownloadSubtext >
110- Version { dlInfo . downloadVersion } for { os } |{ " " }
111- < a href = { dlInfo . allDownloads } > Other Versions</ a >
68+ Releases available for < FontAwesomeIcon icon = { faLinux } /> Linux, < FontAwesomeIcon icon = { faApple } /> Mac and < FontAwesomeIcon icon = { faWindows } /> Windows.
11269 </ DownloadSubtext >
11370 </ div >
11471)
11572
116- const DevDownloadButton = ( ) => (
117- < div >
118- < StyledDownloadButtonDev href = { dlInfo . downloadDev } >
119- < FontAwesomeIcon icon = { faDownload } /> Download Development Build
120- </ StyledDownloadButtonDev >
121- < DownloadSubtext > Version { dlInfo . downloadDevVersion } </ DownloadSubtext >
122- </ div >
123- )
124-
12573const Download = ( ) => {
126- const [ OSName , setOSName ] = useState ( "Other" )
127-
128- useEffect ( ( ) => {
129- setOSName ( detectOS ( ) )
130- } , [ ] )
131-
13274 const images = useStaticQuery ( graphql `{
13375 banner: file(
13476 relativePath: {eq: "banners/CS-Studio-Keyvisual_banner_3_darker.png"}
@@ -141,42 +83,22 @@ const Download = () => {
14183
14284 return (
14385 < Layout >
144- < SEO title = "Download" />
86+ < Seo title = "Download" />
14587 < Banner
14688 imageFluid = { images . banner . childImageSharp . gatsbyImageData }
14789 text = "Download"
14890 />
14991 < Container >
92+ < DownloadText >
93+ < p >
94+ Get the latest Releases on GitHub
95+ </ p >
96+ </ DownloadText >
97+
15098 < Flex >
151- < OSButtons OSName = { OSName } >
152- < button onClick = { ( ) => setOSName ( "Linux" ) } className = "osLinux" >
153- < FontAwesomeIcon icon = { faLinux } /> Linux
154- </ button >
155- < button onClick = { ( ) => setOSName ( "Mac" ) } className = "osMac" >
156- < FontAwesomeIcon icon = { faApple } /> Mac
157- </ button >
158- < button onClick = { ( ) => setOSName ( "Windows" ) } className = "osWindows" >
159- < FontAwesomeIcon icon = { faWindows } /> Windows
160- </ button >
161- </ OSButtons >
99+ < DownloadButtonPhoebus />
162100 </ Flex >
163- < Flex >
164- { ( OSName === "Linux" || OSName === "Other" ) && (
165- < DownloadButton link = { dlInfo . downloadStableLinux } os = { "Linux" } />
166- ) }
167-
168- { OSName === "Mac" && (
169- < DownloadButton link = { dlInfo . downloadStableMac } os = { "Mac" } />
170- ) }
171101
172- { OSName === "Windows" && (
173- < DownloadButton
174- link = { dlInfo . downloadStableWindows }
175- os = { "Windows" }
176- />
177- ) }
178- < DevDownloadButton />
179- </ Flex >
180102 < h2 > Site Specific Versions</ h2 >
181103 < SiteSpecificVersions />
182104 < div style = { { marginBottom : `1rem` } } > </ div >
@@ -185,13 +107,4 @@ const Download = () => {
185107 ) ;
186108}
187109
188- const detectOS = ( ) => {
189- let OSName = "Other"
190- if ( window . navigator . userAgent . indexOf ( "Windows" ) !== - 1 ) OSName = "Windows"
191- if ( window . navigator . userAgent . indexOf ( "Mac" ) !== - 1 ) OSName = "Mac"
192- if ( window . navigator . userAgent . indexOf ( "Linux" ) !== - 1 ) OSName = "Linux"
193-
194- return OSName
195- }
196-
197110export default Download
0 commit comments