1
0
mirror of https://github.com/byulmaru/quesdon synced 2024-11-30 15:58:01 +09:00

gitのコミットを表示するように

This commit is contained in:
rinsuki 2018-01-20 22:38:46 +09:00
parent c0b28dcb09
commit e19a12a27d
4 changed files with 10 additions and 6 deletions

View File

@ -1,3 +1,5 @@
import { csrfToken } from "./initial-state";
const fetchDefaults = require("fetch-defaults")
export default function apiFetch(url: string, params?: RequestInit) {
@ -5,7 +7,7 @@ export default function apiFetch(url: string, params?: RequestInit) {
params = Object.assign({
credentials: "include",
headers: {
"X-CSRF-Token": (<any>window).CSRF_TOKEN
"X-CSRF-Token": csrfToken
}
}, params)
return window.fetch(url, params)

View File

@ -1,11 +1,11 @@
import * as React from "react"
import { Link } from "react-router-dom";
import { usingDarkTheme } from "../initial-state";
import { usingDarkTheme, gitVersion } from "../initial-state";
export default class Footer extends React.Component {
render() {
return <footer className="container">
<p>Quesdon AGPL-3.0 <a href="https://github.com/rinsuki/quesdon"></a></p>
<p>Quesdon AGPL-3.0 <a href="https://github.com/rinsuki/quesdon"></a> ({gitVersion.slice(0,7)})</p>
<p>: <a href="https://mstdn.jp/@quesdon">@quesdon@mstdn.jp</a> <Link to="/@quesdon@mstdn.jp">Quesdon ()</Link></p>
<p>: <a href="https://mstdn.maud.io/@rinsuki">@rinsuki@mstdn.maud.io</a></p>
<p>

View File

@ -3,6 +3,7 @@ import { APIUser } from "../api-interfaces";
const w = <any>window
export const me: APIUser | undefined = w.USER
export const csrfToken: string = w.CSRFTOKEN
export const csrfToken: string = w.CSRF_TOKEN
export const usingDarkTheme: boolean = !!localStorage.getItem("using-dark-theme")
export const usingDarkTheme: boolean = !!localStorage.getItem("using-dark-theme")
export const gitVersion = w.GIT_VERSION

View File

@ -1,14 +1,15 @@
doctype html
html
head
meta(name="viewport",content="width=device-width")
if user
script window.USER=JSON.parse(atob("!{user}"))
else
script window.USER=undefined
script window.CSRF_TOKEN="#{csrfToken}"
script window.GIT_VERSION="#{GIT_COMMIT}"
script(src="https://cdn.polyfill.io/v2/polyfill.js?features=fetch")
script(src="/assets/bundle.js?version="+GIT_COMMIT)
meta(name="git-version", content=GIT_COMMIT)
body
#root
p ...あれ、もしかしてページが表示されてませんか?