-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathApp.tsx
46 lines (40 loc) · 1.04 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React, { useState } from "react";
import { Localized } from "@fluent/react";
import { FluentDateTime } from "@fluent/bundle";
import { Hello } from "./Hello";
import { SignIn } from "./SignIn";
import { LanguageSelector } from "./LanguageSelector";
export function App() {
let [date] = useState(() => new Date());
return <>
<Hello />
<Localized
id="today-date"
vars={{
date: new FluentDateTime(date.getTime(), {
month: "long",
day: "numeric",
})
}}
>
<p>
{"Today is {$date}."}
</p>
</Localized>
<Localized
id="today-weekday"
vars={{
date: new FluentDateTime(date.getTime(), {
weekday: "long",
})
}}
>
<p>
{"It's {$date}."}
</p>
</Localized>
<SignIn />
<hr />
<LanguageSelector />
</>;
}