Skip to content

World Clock assignment - Calvin#12

Open
Cnkh6069 wants to merge 2 commits intorocketacademy:mainfrom
Cnkh6069:main
Open

World Clock assignment - Calvin#12
Cnkh6069 wants to merge 2 commits intorocketacademy:mainfrom
Cnkh6069:main

Conversation

@Cnkh6069
Copy link
Copy Markdown

No description provided.

Comment on lines +33 to +52
<Row className="table-row">
<Col className="table-cell">Asia/Singapore:</Col>
<Col className="table-time">
<Clock timeZone="Asia/Singapore" />
</Col>
</Row>

<Row className="table-row">
<Col className="table-cell">Australia/Canberra:</Col>
<Col className="table-cell">
<Clock timeZone="Australia/Canberra" />
</Col>
</Row>

<Row className="table-row">
<Col className="table-cell">Europe/Berlin:</Col>
<Col className="table-cell">
<Clock timeZone="Europe/Berlin" />
</Col>
</Row>
Copy link
Copy Markdown

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-cell">{item.city}</Col>
        <Col className="table-cell">
          <Clock timeZone={item.timeZone} />
        </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