@@ -1,6 +1,6 @@
1import Head from "next/head";
1import Head from "next/head";
2import Link from "next/link";
2import Link from "next/link";
3−import { useState } from "react";
3+import React, { useState, useEffect } from "react";
4import Container from "../components/Container";
4import Container from "../components/Container";
5import SingleColumn from "../components/SingleColumn";
5import SingleColumn from "../components/SingleColumn";
6import Header from "../components/Header";
6import Header from "../components/Header";
@@ -14,6 +14,37 @@ import { contact } from "../lib/constants";
15export default function Home({ posts, events, openGrantsCount, toggleSearch }) {
15export default function Home({ posts, events, openGrantsCount, toggleSearch }) {
16 const [tab, setTab] = useState(0);
16 const [tab, setTab] = useState(0);
17+ const [heroButton, setHeroButton] = useState(<div />);
19+ const detectOS = () => {
20+ const agent = window.navigator.appVersion;
21+ if (agent.includes("Win")) {
23+ <span className="button-lg type-ui mb-5 bg-ultraDeepWall text-white">
24+ Coming soon for Windows
27+ } else if (agent.includes("Mac")) {
29+ <a href="https://github.com/arthyn/port/releases/latest/download/Port.dmg">
30+ <button className="button-lg type-ui mb-5 bg-green text-white">
35+ } else if (agent.includes("Linux")) {
37+ <code className="button-lg type-ui mb-5 bg-ultraDeepWall text-white">
38+ sudo snap install port
45+ setHeroButton(detectOS());
18 <Container>
49 <Container>
19 <SingleColumn>
50 <SingleColumn>
@@ -43,10 +74,13 @@ export default function Home({ posts, events, openGrantsCount, toggleSearch }) {
43 Getting into Urbit is now as simple as installing an app on your
74 Getting into Urbit is now as simple as installing an app on your
46− <button className="button-lg type-ui mb-5 bg-green text-white">
77+ {heroButton}
47− Download For Mac
78+ <a
48− </button>
79+ href="https://github.com/arthyn/port"
49− <a className="type-ui text-gray">View on GitHub</a>
80+ className="type-ui text-gray"
51 <div className="w-full hero-image-height hero-image mt-8" />
85 <div className="w-full hero-image-height hero-image mt-8" />