-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
70 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<template> | ||
<div class="grid grid-flow-row overflow-hidden"> | ||
<HeroSection /> | ||
<WhatIsWitnetSection class="padding-y px-4" /> | ||
<CoinSection class="padding-y px-4" /> | ||
<BuySection class="padding-y px-4" /> | ||
<SecureSection class="padding-y px-4" /> | ||
<BuildSection class="padding-y px-4" /> | ||
<ExploreSection class="padding-y px-4" /> | ||
<TutorialsSection class="padding-y px-4" /> | ||
<CommunitySection class="padding-y px-4" /> | ||
<Newsletter class="padding-y px-4" /> | ||
<FooterSection class="padding-y px-4" /> | ||
<WhatIsWitnetSection class="pt-10 pb-10 pt- px-4" /> | ||
<CoinSection class="pt-10 pb-10 px-4" /> | ||
<BuySection class="pt-10 pb-10 px-4" /> | ||
<SecureSection class="pt-10 pb-10 px-4" /> | ||
<BuildSection class="pt-10 pb-10 px-4" /> | ||
<ExploreSection class="pt-10 pb-10 px-4" /> | ||
<TutorialsSection class="pt-10 pb-10 px-4" /> | ||
<CommunitySection class="pt-10 pb-10 px-4" /> | ||
<Newsletter class="pt-10 pb-10 px-4" /> | ||
<FooterSection class="pt-10 pb-10 px-4" /> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.padding-y { | ||
/* .pt-10 pb-10 { | ||
padding-top: 96px; | ||
padding-bottom: 96px; | ||
} | ||
} */ | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const DEFAULT_OS = 'Linux' | ||
|
||
export function getBrowserOs(navigator: any) { | ||
const supportedOs = ['Win', 'Mac', 'Linux'] | ||
const platform = navigator.platform | ||
|
||
return supportedOs.find((os) => platform.includes(os)) || DEFAULT_OS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { getBrowserOs } from './getBrowserOs' | ||
export const URL_RELEASE_BASE = | ||
'https://api.github.com/repos/witnet/sheikah/releases/latest' | ||
|
||
export async function getLatestRelease(navigator: any) { | ||
return await fetch(URL_RELEASE_BASE).then(async (result: any) => { | ||
const os = await getBrowserOs(navigator).toLowerCase() | ||
const macRelease = await result.data.assets.find((asset: any) => | ||
asset.browser_download_url.includes('.dmg') | ||
) | ||
const linuxRelease = await result.data.assets.find((asset: any) => | ||
asset.browser_download_url.includes('.AppImage') | ||
) | ||
const windowsRelease = await result.data.assets.find((asset: any) => | ||
asset.browser_download_url.includes('.exe') | ||
) | ||
const release = { | ||
linux: { | ||
platform: 'GNU / Linux', | ||
releaseUrl: linuxRelease.browser_download_url, | ||
downloadName: linuxRelease.name, | ||
}, | ||
win: { | ||
platform: 'Windows', | ||
releaseUrl: windowsRelease.browser_download_url, | ||
downloadName: windowsRelease.name, | ||
}, | ||
mac: { | ||
platform: 'Mac OS', | ||
releaseUrl: macRelease.browser_download_url, | ||
downloadName: windowsRelease.name, | ||
}, | ||
} | ||
return (release as any)[os] as any | ||
}) | ||
} |