+const Tabs = {
+ "feed": {
+ title: "Feed",
+ icon: "Rss",
+ component: (props) => {
+ return <>
+
+ >
+ }
+ },
+ "livestrems": {
+ title: "Livestrems",
+ icon: "Tv",
+ component: (props) => {
+ return <>
+
+ >
+ }
+ },
+}
+
+export default class Dashboard extends React.Component {
+ state = {
+ activeTab: "feed"
+ }
+
+ primaryPanelRef = React.createRef()
+
+ componentDidMount() {
+ app.eventBus.emit("style.compactMode", false)
+ }
+
+ renderActiveTab() {
+ const tab = Tabs[this.state.activeTab]
+
+ if (!tab) {
+ return null
+ }
+
+ return React.createElement(tab.component)
+ }
+
+ handleTabChange = (key) => {
+ if (this.state.activeTab === key) return
+
+ // set to primary panel fade-opacity-leave class
+ this.primaryPanelRef.current.classList.add("fade-opacity-leave")
+
+
+ setTimeout(() => {
+ this.setState({ activeTab: key })
+ }, 200)
+
+ // remove fade-opacity-leave class after animation
+ setTimeout(() => {
+ this.primaryPanelRef.current.classList.remove("fade-opacity-leave")
+ }, 300)
+ }
+
+ render() {
+ return
+
+
+
+ {this.renderActiveTab()}
+
+
+
+
+
+
Browse
+
this.handleTabChange(key)}
+ >
+ {Object.keys(Tabs).map((key) => {
+ const tab = Tabs[key]
+
+ return
+ {tab.title}
+
+ })}
+
+
+
+
-
}
}
\ No newline at end of file
diff --git a/packages/app/src/pages/home/index.less b/packages/app/src/pages/home/index.less
index 7a9b0cdd..8ee112da 100644
--- a/packages/app/src/pages/home/index.less
+++ b/packages/app/src/pages/home/index.less
@@ -1,22 +1,28 @@
-.explore {
- display : flex;
- flex-direction : column;
- align-items : center;
- justify-content: center;
+.dashboard {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ grid-template-rows: 1fr;
+ grid-column-gap: 20px;
+ grid-row-gap: 0px;
width: 100%;
- .header {
- display : flex;
- flex-direction : column;
- align-items : center;
- justify-content: center;
+ .panel {
+ display: flex;
+ flex-direction: column;
- width : 100%;
- max-width: 40vw;
- }
+ align-items: center;
- >div {
- margin-bottom: 15px;
+ >div {
+ margin-bottom: 15px;
+ }
+
+ .card {
+ background-color: var(--background-color-accent);
+ border-radius: 12px;
+ padding: 20px;
+
+ min-width: 20vw;
+ }
}
}
\ No newline at end of file