update,
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
.container {
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.container strong {
|
||||
font-size: 20px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.container p {
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
color: #8c8c8c;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.container a {
|
||||
text-decoration: none;
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
import './ExploreContainer.css';
|
||||
|
||||
interface ContainerProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
const ExploreContainer: React.FC<ContainerProps> = ({ name }) => {
|
||||
return (
|
||||
<div className="container">
|
||||
<strong>{name}</strong>
|
||||
<p>
|
||||
Explore{' '}
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href="https://ionicframework.com/docs/components"
|
||||
>
|
||||
UI Components
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ExploreContainer;
|
@@ -0,0 +1,96 @@
|
||||
import {
|
||||
IonAvatar,
|
||||
IonButton,
|
||||
IonCol,
|
||||
IonIcon,
|
||||
IonImg,
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonRow,
|
||||
IonText,
|
||||
} from '@ionic/react';
|
||||
import {
|
||||
arrowRedoOutline,
|
||||
chatboxOutline,
|
||||
ellipsisHorizontal,
|
||||
globe,
|
||||
heart,
|
||||
thumbsUp,
|
||||
thumbsUpOutline,
|
||||
} from 'ionicons/icons';
|
||||
import '../pages/Tab2.css';
|
||||
import React from 'react';
|
||||
|
||||
const Post = (props): React.JSX.Element => {
|
||||
const { post } = props;
|
||||
|
||||
return (
|
||||
<IonRow className="ion-no-padding ion-no-margin post">
|
||||
<IonCol size="12" className="ion-no-padding ion-no-margin">
|
||||
<div className="post-container">
|
||||
<IonItem lines="none" className="post-header ion-no-margin ion-no-padding">
|
||||
<IonAvatar slot="start" className="ion-no-padding ion-no-margin">
|
||||
<IonImg src={post.avatar} />
|
||||
</IonAvatar>
|
||||
|
||||
<IonLabel>
|
||||
<h3>{post.name}</h3>
|
||||
<p>
|
||||
{post.sponsored ? 'Sponsored' : post.time}
|
||||
|
||||
<IonIcon icon={globe} />
|
||||
</p>
|
||||
</IonLabel>
|
||||
|
||||
<IonIcon icon={ellipsisHorizontal} />
|
||||
</IonItem>
|
||||
|
||||
<IonItem lines="none" className="post-content ion-no-margin ion-no-padding">
|
||||
<p>{post.message}</p>
|
||||
</IonItem>
|
||||
|
||||
{post.image && <IonImg src={post.image} />}
|
||||
|
||||
{post.sponsored && (
|
||||
<div className="post-link ion-no-margin ion-no-padding">
|
||||
<IonLabel>
|
||||
<p>ionicframework.com</p>
|
||||
<h3>Start building apps today!</h3>
|
||||
</IonLabel>
|
||||
|
||||
<IonButton>Learn more</IonButton>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="post-likes ion-no-margin ion-no-padding">
|
||||
<div className="post-like-icons">
|
||||
<IonIcon icon={thumbsUp} />
|
||||
<IonIcon icon={heart} />
|
||||
</div>
|
||||
|
||||
{post.sponsored && <p>{post.views} Views</p>}
|
||||
</div>
|
||||
|
||||
<div className="post-actions ion-no-margin ion-no-padding ion-text-center">
|
||||
<IonCol size="4">
|
||||
<IonIcon icon={thumbsUpOutline} />
|
||||
<IonText>Like</IonText>
|
||||
</IonCol>
|
||||
|
||||
<IonCol size="4">
|
||||
<IonIcon icon={chatboxOutline} />
|
||||
<IonText>Comment</IonText>
|
||||
</IonCol>
|
||||
|
||||
<IonCol size="4">
|
||||
<IonIcon icon={arrowRedoOutline} />
|
||||
<IonText>Share</IonText>
|
||||
</IonCol>
|
||||
</div>
|
||||
</div>
|
||||
</IonCol>
|
||||
</IonRow>
|
||||
);
|
||||
};
|
||||
|
||||
export default Post;
|
@@ -0,0 +1,33 @@
|
||||
import React from 'react';
|
||||
import { IonIcon, IonLabel, IonTabBar, IonTabButton, IonTabs, IonRouterOutlet } from '@ionic/react';
|
||||
import { Redirect, Route } from 'react-router-dom';
|
||||
import Tab1 from '../pages/Tab1';
|
||||
import Tab2 from '../pages/Tab2';
|
||||
import Tab3 from '../pages/Tab3';
|
||||
import { chatboxOutline, cogOutline, personOutline } from 'ionicons/icons';
|
||||
|
||||
const Tabs = (props): React.JSX.Element => {
|
||||
return (
|
||||
<IonTabs>
|
||||
<IonRouterOutlet>
|
||||
<Route exact path="/tabs/tab1" render={(props) => <Tab1 {...props} />} />
|
||||
<Route exact path="/tabs/tab2" render={(props) => <Tab2 {...props} />} />
|
||||
<Route exact path="/tabs/tab3" render={(props) => <Tab3 {...props} />} />
|
||||
</IonRouterOutlet>
|
||||
|
||||
<IonTabBar slot="bottom">
|
||||
<IonTabButton tab="tab1" href="/tabs/tab1">
|
||||
<IonIcon icon={chatboxOutline} />
|
||||
</IonTabButton>
|
||||
<IonTabButton tab="tab2" href="/tabs/tab2">
|
||||
<IonIcon icon={personOutline} />
|
||||
</IonTabButton>
|
||||
<IonTabButton tab="tab3" href="/tabs/tab3">
|
||||
<IonIcon icon={cogOutline} />
|
||||
</IonTabButton>
|
||||
</IonTabBar>
|
||||
</IonTabs>
|
||||
);
|
||||
};
|
||||
|
||||
export default Tabs;
|
Reference in New Issue
Block a user