Skip to content

Commit

Permalink
my chnages
Browse files Browse the repository at this point in the history
  • Loading branch information
zintarh committed Apr 6, 2022
1 parent 676fcbf commit b795031
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 34 deletions.
9 changes: 5 additions & 4 deletions src/components/Navbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Tab, Tabs, TabList, TabPanel } from "react-tabs";
import "react-tabs/style/react-tabs.css";
import { Link } from "react-router-dom";

export default () => (
<nav className=" ">
Expand Down Expand Up @@ -40,12 +41,12 @@ export default () => (
About
</a>

<a
href="#"
class="bg-primary text-white text-sm font-semibold hover:text-secondary px-4 py-3 rounded-one "
<Link
to="/auth"
class="bg-secondary text-white capitalize text-sm font-extrabold hover:text-primary px-4 py-3 rounded-one "
>
Login / Register
</a>
</Link>
</div>
</div>
</div>
Expand Down
51 changes: 31 additions & 20 deletions src/pages/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const UserDashboard = () => {

const dispatch = useDispatch();
const { register, errors, handleSubmit } = useForm();

const formatter = (date) =>{
return new Intl.DateTimeFormat('en-US', {year: 'numeric', month: '2-digit',day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit'}).format(date)
}

const onSubmit = async (request) => {
const data = new FormData();
Expand All @@ -66,8 +70,14 @@ const UserDashboard = () => {

await dispatch(createFeed(spoons));

await dispatch(clearState());

if (isSuccessCreate) {
console.log("sjjshshshjshjs")
toast.success("Feed was created successfully!");
setShowModal(false);
dispatch(getFeeds());
dispatch(clearState());

}

};

Expand Down Expand Up @@ -168,24 +178,25 @@ const UserDashboard = () => {
</svg>
</div>
) : (
<div class="p-10 grid grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-6">
{feeds == null ? (
<h1 className="text-xl uppercase text-center text-gray-700 ">
No feeds or internet, please refresh
</h1>
) : (

<div>

{

false ? (<h1 className="text-center pt-20 text-gray-500">No feeds or internet, please refresh your network</h1>) :
<div class="p-10 grid grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-10">
{

feeds.map((feed) => (
<div className=" ">
{
<div
className=" h-48 text-center rounded-sm "
style={{ backgroundImage: `url(${feed.feed_media})` }}
title="Mountain"
></div>
<div className="img">
<img className="rounded-t-lg" src={feed.feed_media} alt="" />
</div>
}
<div className=" bg-white py-4 shadow-xl rounded-sm p-4 flex flex-col justify-between leading-normal">
<div className=" bg-white py-4 mb-10 shadow-2xl shadow- rounded-lg p-4 flex flex-col justify-between leading-normal">
<div className="mb-4">
<p className="text-sm text-gray-600 flex items-center">
<p className="text-xs text-gray-600 flex items-center">
<svg
className="fill-current text-gray-500 w-3 h-3 mr-2"
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -195,7 +206,7 @@ const UserDashboard = () => {
</svg>
{feed.tag}
</p>
<div className="text-primary font-bold text-xl mb-2">
<div className="text-primary capitalize font-bold text-lg mb-2">
{feed.feed_title}
</div>
<p className="text-gray-700 text-sm w-2/4">
Expand All @@ -208,17 +219,17 @@ const UserDashboard = () => {
src={logo}
/>
<div className="text-sm">
<p className="text-gray-900 leading-none">
ogplateau
<p className="text-gray-900 pb-2 leading-none">
</p>
<p className="text-gray-600 ">{feed.createdAt}</p>
</div>
</div>
</div>
</div>
))
)}
}
</div>
}</div>
)}
</div>
</header>
Expand All @@ -230,7 +241,7 @@ const UserDashboard = () => {
<>
<div className="flex justify-center items-center overflow-x-hidden overflow-y-auto fixed top-0 right-0 left-0 z-50 w-full md:inset-0 h-modal md:h-full">
<div className="relative p-3 w-full max-w-2xl h-full md:h-auto">
<div className="border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-white outline-none focus:outline-none">
<div className="border-0 rounded-lg drop-shadow-2xl relative flex flex-col w-full bg-white outline-none focus:outline-none">
<div className="flex items-start justify-between p-3 border-b border-solid border-gray-300 rounded-t ">
<h6 className="text-xl font=semibold">Create new feed</h6>
<button
Expand Down
23 changes: 14 additions & 9 deletions src/pages/HomePage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Navbar from "../components/Navbar";

import { Link } from "react-router-dom";

const HomePage = () => {
return (
<div className="wrapper">
Expand All @@ -17,12 +19,12 @@ const HomePage = () => {
cupiditate eius.
</p>
<div className="heder-btns pt-10">
<a
href="/auth"
<Link
to="/auth"
class="bg-secondary text-white capitalize text-sm font-extrabold hover:text-primary px-4 py-3 rounded-one "
>
Login / Register
</a>
</Link>

<a
href="#"
Expand Down Expand Up @@ -98,7 +100,7 @@ const HomePage = () => {

<div className="mt-8">
<a
href="/auth"
href="/auth/"
class="bg-secondary2 shadow-md text-primary capitalize text-sm font-semibold hover:text-primary px-4 py-3 rounded-one "
>
Login / Register
Expand Down Expand Up @@ -345,12 +347,12 @@ const HomePage = () => {
<div className="card">
<h1 className="text-primary text-2xl">Our Action Plans</h1>
<p className="pt-8 text-sm">
Plateau joined OGP as part of the 2020 cohort. They are currently implementing five commitments from their 2021-2023 action plan.

Plateau joined OGP as part of the 2020 cohort. They are
currently implementing five commitments from their 2021-2023
action plan.
</p>

</div>

<div className="card">
<h1 className="text-primary text-2xl">Our Action Plans</h1>
<div className="link pt-4">
Expand Down Expand Up @@ -425,7 +427,10 @@ const HomePage = () => {
</div>
</div>
<hr className="mt-10 border-2 bg-inputcolor" />
<p className="text-center text-sm">Copyright © 2021 Designed and Developed by nHub Nigeria. All Rights Reserved</p>
<p className="text-center text-sm">
Copyright © 2021 Designed and Developed by nHub Nigeria. All
Rights Reserved
</p>
</div>
</footer>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/redux/feed/feedSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createSlice } from "@reduxjs/toolkit"
import { createFeed, getFeeds } from "./feed-comp";

const initialState = {
feeds: null,
feeds: [],
isLoading: false,
isSuccess: false,
isSuccessCreate: false,
Expand Down

0 comments on commit b795031

Please sign in to comment.