New components, convert hooks to components, bug fixes.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { get } from 'lib/web';
|
||||
import Link from './Link';
|
||||
import WebsiteChart from './WebsiteChart';
|
||||
import Icon from './Icon';
|
||||
import { get } from 'lib/web';
|
||||
import Arrow from 'assets/arrow-right.svg';
|
||||
import styles from './WebsiteList.module.css';
|
||||
|
||||
export default function WebsiteList() {
|
||||
@@ -16,18 +18,23 @@ export default function WebsiteList() {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<>
|
||||
{data &&
|
||||
data.websites.map(({ website_id, label }) => (
|
||||
<div key={website_id}>
|
||||
<h2>
|
||||
<Link href={`/website/${website_id}/${label}`}>
|
||||
<a>{label}</a>
|
||||
<div key={website_id} className={styles.website}>
|
||||
<div className={styles.header}>
|
||||
<h2>
|
||||
<Link href={`/website/${website_id}/${label}`} className={styles.title}>
|
||||
{label}
|
||||
</Link>
|
||||
</h2>
|
||||
<Link href={`/website/${website_id}/${label}`} className={styles.details}>
|
||||
<Icon icon={<Arrow />} /> View details
|
||||
</Link>
|
||||
</h2>
|
||||
</div>
|
||||
<WebsiteChart key={website_id} title={label} websiteId={website_id} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user