Skip to content

WX - World Clock Assignment #11

Open
wenxin-p wants to merge 4 commits intorocketacademy:mainfrom
wenxin-p:main
Open

WX - World Clock Assignment #11
wenxin-p wants to merge 4 commits intorocketacademy:mainfrom
wenxin-p:main

Conversation

@wenxin-p
Copy link

No description provided.

Comment on lines +22 to +44
<Row className="table-row">
<Col className="table-col">
<p>Asia/Seoul</p>
</Col>
<Col className="table-time">
<p>
<Clock timeZone="Asia/Seoul" />
</p>
</Col>
</Row>
<Row className="table-row">
<Col className="table-col">
<p>Asia/Singapore</p>
</Col>
<Col className="table-time">
<p>
<Clock timeZone="Asia/Singapore" />
</p>
</Col>
</Row>
<Row className="table-row">
<Col className="table-col">
<p>Europe/London</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can improve this by using a data structure and map it!

const data = [
{
    timeZone: "Europe/Berlin",
    city: "Berlin"
}, ...]

and then

data.map((item) => {
     return (
            <Row className="table-row">
            <Col className="table-col">
              <p>{item.city}</p>
            </Col>
            <Col className="table-time">
              <p>
                <Clock timeZone={item.timeZone} />
              </p>
            </Col>
          </Row>
     )
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants