From 4b593e794ed05c4c81fc4dbd4127e42a6e70ce39 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 8 Jan 2018 18:14:21 -0800 Subject: [PATCH] start on timeline implementation --- routes/_components/NotLoggedInHome.html | 33 +++++++++++++ routes/_components/Timeline.html | 29 +++++++++++ routes/_utils/store.js | 10 +++- routes/index.html | 64 ++++++------------------- routes/settings/add-instance.html | 2 +- 5 files changed, 85 insertions(+), 53 deletions(-) create mode 100644 routes/_components/NotLoggedInHome.html create mode 100644 routes/_components/Timeline.html diff --git a/routes/_components/NotLoggedInHome.html b/routes/_components/NotLoggedInHome.html new file mode 100644 index 00000000..3795e550 --- /dev/null +++ b/routes/_components/NotLoggedInHome.html @@ -0,0 +1,33 @@ + +

Pinafore is a web client for Mastodon, optimized for speed and simplicity.

+ +

To get started, log in to an instance.

+ +

Don't have an instance? Join Mastodon!

+ \ No newline at end of file diff --git a/routes/_components/Timeline.html b/routes/_components/Timeline.html new file mode 100644 index 00000000..10fb833d --- /dev/null +++ b/routes/_components/Timeline.html @@ -0,0 +1,29 @@ + + \ No newline at end of file diff --git a/routes/_utils/store.js b/routes/_utils/store.js index 7381a5d6..47f11935 100644 --- a/routes/_utils/store.js +++ b/routes/_utils/store.js @@ -24,8 +24,14 @@ const store = new LocalStorageStore({ instanceNameInSearch: '' }) -if (process.browser) { - window.store = store +store.compute( + 'isUserLoggedIn', + ['currentOauthInstance'], + currentOauthInstance => !!currentOauthInstance && currentOauthInstance.access_token +) + +if (process.browser && process.env.NODE_ENV !== 'production') { + window.store = store // for debugging } export { store } \ No newline at end of file diff --git a/routes/index.html b/routes/index.html index 7367ebb6..831159b8 100644 --- a/routes/index.html +++ b/routes/index.html @@ -1,66 +1,30 @@ <:Head> - Home + Pinafore - -

Pinafore is a web client for Mastodon, optimized for speed and simplicity.

- -

To get started, log in to an instance.

- -

Don't have an instance? Join Mastodon!

+ {{#if $isUserLoggedIn}} +
+ {{else}} + + {{/if}}
+ \ No newline at end of file diff --git a/routes/settings/add-instance.html b/routes/settings/add-instance.html index 2f42cdc4..ede3a8e8 100644 --- a/routes/settings/add-instance.html +++ b/routes/settings/add-instance.html @@ -8,7 +8,7 @@

Log in to your instance to use Pinafore.

-
+