Feed and ionic
@@ -9,5 +9,8 @@
|
|||||||
"launchShowDuration": 0
|
"launchShowDuration": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"server": {
|
||||||
|
"url": "http://192.168.86.26:3000"
|
||||||
|
},
|
||||||
"cordova": {}
|
"cordova": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import Card from '../ui/Card';
|
|||||||
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/react';
|
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/react';
|
||||||
import { homeItems } from '../../store';
|
import { homeItems } from '../../store';
|
||||||
|
|
||||||
const HomeCard = ({ title, type, text, author, image }) => (
|
const FeedCard = ({ title, type, text, author, authorAvatar, image }) => (
|
||||||
<Card className="my-4">
|
<Card className="my-4 mx-auto">
|
||||||
<div>
|
<div>
|
||||||
<img className="rounded-t-xl h-32 w-full object-cover" src={image} />
|
<img className="rounded-t-xl h-32 w-full object-cover" src={image} />
|
||||||
</div>
|
</div>
|
||||||
@@ -12,6 +12,10 @@ const HomeCard = ({ title, type, text, author, image }) => (
|
|||||||
<h4 className="font-bold py-0 text-s text-gray-400 dark:text-gray-500 uppercase">{type}</h4>
|
<h4 className="font-bold py-0 text-s text-gray-400 dark:text-gray-500 uppercase">{type}</h4>
|
||||||
<h2 className="font-bold text-2xl text-gray-800 dark:text-gray-100">{title}</h2>
|
<h2 className="font-bold text-2xl text-gray-800 dark:text-gray-100">{title}</h2>
|
||||||
<p className="sm:text-sm text-s text-gray-500 mr-1 my-3 dark:text-gray-400">{text}</p>
|
<p className="sm:text-sm text-s text-gray-500 mr-1 my-3 dark:text-gray-400">{text}</p>
|
||||||
|
<div className="flex items-center space-x-4">
|
||||||
|
<img src={authorAvatar} className="rounded-full w-10 h-10" />
|
||||||
|
<h3 className="text-gray-500 dark:text-gray-200 m-l-8 text-sm font-medium">{author}</h3>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
@@ -20,12 +24,17 @@ const Home = () => (
|
|||||||
<IonPage>
|
<IonPage>
|
||||||
<IonHeader>
|
<IonHeader>
|
||||||
<IonToolbar>
|
<IonToolbar>
|
||||||
<IonTitle>Inbox</IonTitle>
|
<IonTitle>Feed</IonTitle>
|
||||||
|
</IonToolbar>
|
||||||
|
</IonHeader>
|
||||||
|
<IonContent className="ion-padding" fullscreen>
|
||||||
|
<IonHeader collapse="condense">
|
||||||
|
<IonToolbar>
|
||||||
|
<IonTitle size="large">Feed</IonTitle>
|
||||||
</IonToolbar>
|
</IonToolbar>
|
||||||
</IonHeader>
|
</IonHeader>
|
||||||
<IonContent className="ion-padding">
|
|
||||||
{homeItems.map((i, index) => (
|
{homeItems.map((i, index) => (
|
||||||
<HomeCard {...i} key={index} />
|
<FeedCard {...i} key={index} />
|
||||||
))}
|
))}
|
||||||
</IonContent>
|
</IonContent>
|
||||||
</IonPage>
|
</IonPage>
|
||||||
@@ -1,17 +1,9 @@
|
|||||||
import { Redirect, Route } from 'react-router-dom';
|
import { Redirect, Route } from 'react-router-dom';
|
||||||
import {
|
import { IonRouterOutlet, IonTabs, IonTabBar, IonTabButton, IonIcon, IonLabel } from '@ionic/react';
|
||||||
IonApp,
|
|
||||||
IonRouterOutlet,
|
|
||||||
IonTabs,
|
|
||||||
IonTabBar,
|
|
||||||
IonTabButton,
|
|
||||||
IonIcon,
|
|
||||||
IonLabel,
|
|
||||||
} from '@ionic/react';
|
|
||||||
import { IonReactRouter } from '@ionic/react-router';
|
import { IonReactRouter } from '@ionic/react-router';
|
||||||
import { ellipse, square, triangle } from 'ionicons/icons';
|
import { cog, flash, list } from 'ionicons/icons';
|
||||||
|
|
||||||
import Home from './Home';
|
import Home from './Feed';
|
||||||
import Lists from './Lists';
|
import Lists from './Lists';
|
||||||
import Settings from './Settings';
|
import Settings from './Settings';
|
||||||
|
|
||||||
@@ -20,23 +12,23 @@ const Tabs = () => {
|
|||||||
<IonReactRouter>
|
<IonReactRouter>
|
||||||
<IonTabs>
|
<IonTabs>
|
||||||
<IonRouterOutlet>
|
<IonRouterOutlet>
|
||||||
<Route path="/tabs/home" component={Home} exact={true} />
|
<Route path="/tabs/feed" component={Home} exact={true} />
|
||||||
<Route path="/tabs/lists" component={Lists} exact={true} />
|
<Route path="/tabs/lists" component={Lists} exact={true} />
|
||||||
<Route path="/tabs/settings" component={Settings} exact={true} />
|
<Route path="/tabs/settings" component={Settings} exact={true} />
|
||||||
<Route path="/" render={() => <Redirect to="/tabs/home" />} exact={true} />
|
<Route path="/tabs" render={() => <Redirect to="/tabs/feed" />} exact={true} />
|
||||||
</IonRouterOutlet>
|
</IonRouterOutlet>
|
||||||
<IonTabBar slot="bottom">
|
<IonTabBar slot="bottom">
|
||||||
<IonTabButton tab="tab1" href="/tabs/home">
|
<IonTabButton tab="tab1" href="/tabs/feed">
|
||||||
<IonIcon icon={triangle} />
|
<IonIcon icon={flash} />
|
||||||
<IonLabel>Tab 1</IonLabel>
|
<IonLabel>Feed</IonLabel>
|
||||||
</IonTabButton>
|
</IonTabButton>
|
||||||
<IonTabButton tab="tab2" href="/tabs/lists">
|
<IonTabButton tab="tab2" href="/tabs/lists">
|
||||||
<IonIcon icon={ellipse} />
|
<IonIcon icon={list} />
|
||||||
<IonLabel>Tab 2</IonLabel>
|
<IonLabel>Lists</IonLabel>
|
||||||
</IonTabButton>
|
</IonTabButton>
|
||||||
<IonTabButton tab="tab3" href="/tabs/settings">
|
<IonTabButton tab="tab3" href="/tabs/settings">
|
||||||
<IonIcon icon={square} />
|
<IonIcon icon={cog} />
|
||||||
<IonLabel>Tab 3</IonLabel>
|
<IonLabel>Settings</IonLabel>
|
||||||
</IonTabButton>
|
</IonTabButton>
|
||||||
</IonTabBar>
|
</IonTabBar>
|
||||||
</IonTabs>
|
</IonTabs>
|
||||||
|
|||||||
@@ -9,5 +9,8 @@
|
|||||||
"launchShowDuration": 0
|
"launchShowDuration": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"server": {
|
||||||
|
"url": "http://192.168.86.26:3000"
|
||||||
|
},
|
||||||
"cordova": {}
|
"cordova": {}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 27 KiB |
@@ -3,33 +3,36 @@ import { Store as PullStateStore } from 'pullstate';
|
|||||||
import { lists } from '../mock';
|
import { lists } from '../mock';
|
||||||
|
|
||||||
export const images = [
|
export const images = [
|
||||||
'https://images.unsplash.com/photo-1608091526083-86ae8489ae5c?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=2100&q=80',
|
'https://images.unsplash.com/photo-1610235554447-41505d7962f8?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=882&q=80',
|
||||||
'https://images.unsplash.com/photo-1608050072262-7b26ba63fb46?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=2100&q=80',
|
'https://images.unsplash.com/photo-1610212594948-370947a3ba0b?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=934&q=80',
|
||||||
'https://images.unsplash.com/photo-1607975218223-94f82613e833?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=934&q=80',
|
'https://images.unsplash.com/photo-1610155180433-9994da6a323b?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80',
|
||||||
'https://images.unsplash.com/photo-1608108707326-215150457c9f?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=2100&q=80',
|
|
||||||
'https://images.unsplash.com/photo-1608057681073-9399f209e773?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=934&q=80',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export const homeItems = [
|
export const homeItems = [
|
||||||
{
|
{
|
||||||
title: 'Welcome',
|
title: 'Exploring Maui',
|
||||||
type: 'Blog',
|
type: 'Blog',
|
||||||
text: 'Welcome to the app!',
|
text: 'We just got back from a trip to Maui, and we had a great time...',
|
||||||
author: 'Max',
|
author: 'Max Lynch',
|
||||||
|
authorAvatar: '/img/max.jpg',
|
||||||
image: images[0],
|
image: images[0],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'How to get started',
|
title: 'Arctic Adventures',
|
||||||
type: 'Article',
|
type: 'Blog',
|
||||||
text: 'Getting started with the app is easy! Just follow these 100 steps',
|
text:
|
||||||
author: 'Max',
|
'Last month we took a trek to the Arctic Circle. The isolation was just what we needed after...',
|
||||||
|
author: 'Max Lynch',
|
||||||
|
authorAvatar: '/img/max.jpg',
|
||||||
image: images[1],
|
image: images[1],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Need help?',
|
title: 'Frolicking in the Faroe Islands',
|
||||||
type: 'Support',
|
type: 'Blog',
|
||||||
text: "We're here to help. Available between the hours of 3am and 3:01am every day",
|
text:
|
||||||
author: 'Max',
|
'The Faroe Islands are a North Atlantic archipelago located 320 kilometres (200 mi) north-northwest of Scotland...',
|
||||||
|
author: 'Max Lynch',
|
||||||
|
authorAvatar: '/img/max.jpg',
|
||||||
image: images[2],
|
image: images[2],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||