File tree Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Expand file tree Collapse file tree 3 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ import CtaSection from './sections/CtaSection';
1212import SampleStorySection from './sections/SampleStorySection' ;
1313import links from '@/data/links' ;
1414
15- export default function HomePage ( ) {
15+ export default function HomePage ( { versionNumber } ) {
1616 return (
1717 < div >
1818 < Ribbon onClick = { ( ) => window . open ( links . githubProject ) } >
1919 CodeEdit is currently in development. Check out the roadmap.
2020 </ Ribbon >
21- < HeroSection />
21+ < HeroSection versionNumber = { versionNumber } />
2222 < IntroFeaturesSection />
2323 { /* <SampleStorySection /> */ }
2424 { /* <SampleStorySection /> */ }
Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ const ProductIconWrap = styled.div`
1313 margin-right: auto;
1414` ;
1515
16- const HeroSection = ( ) => {
16+ const HeroSection = ( { versionNumber} ) => {
17+
1718 return (
1819 < Parallax
1920 style = { { overflow : 'visible' } }
@@ -42,7 +43,7 @@ const HeroSection = () => {
4243 CodeEdit is an exciting new code editor written entirely and unapologetically for macOS. Develop any project using any language at speeds like never before with increased efficiency and reliability in an editor that feels right at home on your Mac.
4344 </ Typography >
4445 < Button href = "https://github.com/CodeEditApp/CodeEdit/releases/latest" target = "_blank" > Download Alpha</ Button >
45- < Typography variant = "body-reduced" color = "tertiary" > 0.0.1-alpha | macOS 12 +</ Typography >
46+ < Typography variant = "body-reduced" color = "tertiary" > { versionNumber } | macOS 13 +</ Typography >
4647 </ Stack >
4748 </ Column >
4849 </ Row >
Original file line number Diff line number Diff line change 1- export { default } from '@/components/pages/home' ;
1+ import HomePage from '@/components/pages/home' ;
2+
3+ export default function Home ( props ) {
4+ return (
5+ < HomePage versionNumber = { props . versionNumber } />
6+ ) ;
7+ }
8+
9+ export async function getStaticProps ( ) {
10+ const res = await fetch ( 'https://api.github.com/repos/CodeEditApp/CodeEdit/releases/latest' ) ;
11+ const data = await res . json ( ) ;
12+
13+ return {
14+ props : {
15+ versionNumber : data . tag_name ,
16+ } ,
17+ revalidate : 60 * 60 * 24 , // 24 hours
18+ } ;
19+ }
You can’t perform that action at this time.
0 commit comments