Select Git revision
EffectUI.cpp
Forked from
Hwanyong Lee / audacity-kr-font
Source project has a limited visibility.
-
Dmitry Vedenko authoredDmitry Vedenko authored
App.js 791 B
import React, { useState } from 'react';
const TimeButton = (props) => {
let [time,setTime]=useState(null);
const displayTime = () => {
let date = new Date();
setTime(date.toLocaleString('ko-KR',{timeZone : props.tz}));
}
return (
<>
<button onClick={displayTime} tz={props.tz}> {props.cn}</button>
<div id = "time">{time}</div>
</>
);
}
const App = () => {
const cityList = [{ cityName : "Seoul", timezone : "Asia/Seoul"}, { cityName : "Tokyo", timezone : "Asia/Tokyo" }, {cityName :"Lagos", timezone : "Africa/Lagos" }]
return (
<>
<h1> What time is it? </h1>
{
cityList.map((name)=> {
return <TimeButton tz={name.timezone} cn = {name.cityName}/> })
}
</>
);
}
export default App;