Skip to content

Commit

Permalink
fix: css on today page
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjaybaskaran01 committed Sep 6, 2021
1 parent d13bc69 commit 9d695b1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/pages/Eventform/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ const EventForm = () => {
</div>
</div>
<div className="col-full mt-6">
<h4>Image URL</h4>
<h4>Image/GIF URL</h4>
<input
type="text"
placeholder="Image URL"
Expand Down
95 changes: 50 additions & 45 deletions src/pages/Today/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,72 @@ import { getDate } from "../../api/Request";
import EventProfile from "../../components/EventProfile";

const Today = () => {

const [event, setEvent] = useState([]);

useEffect(() => {
let date = new Date()
let date = new Date();
const AsyncDay = async () => {
let res = await getDate(date);
setEvent(res);
};
AsyncDay();
}, []);
const history=useHistory()
const history = useHistory();
const routeChange = () => {
let path = "/";
history.push(path);
};

return (
<div className="flex items-start justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">

<div className="px-4 pt-5 pb-4 sm:p-6 sm:pb-4" style={{backgroundColor:"#191927"}}>
<div className="sm:flex sm:items-start">
<div className="mt-3 w-full text-center sm:mt-0 sm:ml-4 sm:text-left">
<button
type="button"
className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white hover:bg-green-700 focus:outline-none sm:ml-3 sm:w-auto sm:text-sm fc-button"
onClick={() => {
routeChange()
}}
style={{backgroundColor:"#4C42C2"}}
>
Go Back
</button>
<h3
className="text-center text-md sm:text-lg leading-6 font-bold mt-6"
id="modal-title" style={{color:"aliceblue",fontFamily:"Inter"}}
>
TODAY'S EVENTS
</h3>
<div className="mt-2">
<div className="flex flex-col sm:grid sm:gap-x-5 sm:grid-cols-2 " >
{(event.length!==0) ? (
event.map((item) => {
item["todayChecker"]=true
return (
<div className="eventprofile">
<EventProfile key={item._id} {...item}/>;
</div>)
})
) : (
<>
<h2 className="text-white text-center">Schedule on this date seems clear!</h2>
</>
)}
</div>
</div>
<div className="flex items-start justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div
className="px-4 pt-5 pb-4 sm:p-6 sm:pb-4"
style={{ backgroundColor: "#191927" }}
>
<div className="sm:flex sm:items-start">
<div className="mt-3 w-full text-center sm:mt-0 sm:ml-4 sm:text-left">
<button
type="button"
className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white hover:bg-green-700 focus:outline-none sm:ml-3 sm:w-auto sm:text-sm fc-button"
onClick={() => {
routeChange();
}}
style={{ backgroundColor: "#4C42C2" }}
>
Go Back
</button>
<h3
className="text-center text-md sm:text-lg leading-6 font-bold mt-6"
id="modal-title"
style={{ color: "aliceblue", fontFamily: "Inter" }}
>
TODAY'S EVENTS
</h3>
<div className="mt-2">
{event.length !== 0 ? (
<div className="flex flex-col sm:grid sm:gap-x-5 sm:grid-cols-2 ">
{event.map((item) => {
item["todayChecker"] = true;
return (
<div className="eventprofile">
<EventProfile key={item._id} {...item} />;
</div>
);
})}
</div>
</div>
) : (
<>
<h2 className="text-white text-center">
Schedule on this date seems clear!
</h2>
</>
)}
</div>
</div>
);
}
</div>
</div>
</div>
);
};

export default Today;
export default Today;

0 comments on commit 9d695b1

Please sign in to comment.