Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/Images/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/logoimg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/postimg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions src/components/Login/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from "react";
import useAuth from "../../hooks/useAuth";
import axios from "axios";
import { useLocation, useNavigate } from "react-router-dom";

import backgroundImage from '../../Images/logoimg.jpg'
const Signin = () => {
const [data, setData] = useState({
email: "",
Expand Down Expand Up @@ -47,11 +47,8 @@ const Signin = () => {
<div className="flex justify-center h-screen">
<div
className="hidden bg-cover lg:block lg:w-2/3"
style={{
backgroundImage:
"url(https://images.unsplash.com/photo-1557992260-ec58e38d363c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=774&q=80)",
}}
>
style={{ backgroundImage: `url('${backgroundImage}')` }}
>
<div className="flex items-center h-full px-20 bg-gray-900 bg-opacity-40">
<div>
<h2 className="text-4xl font-bold text-white">TechTalk News</h2>
Expand Down
8 changes: 5 additions & 3 deletions src/components/PostCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import toast from "react-hot-toast";
import { usePosts } from "../context/postContext";
import { useNavigate } from "react-router-dom";
import moment from "moment";
import logoImg from "../Images/postimg.jpg"


export function insertMedia(filePath) {
var extension = filePath.split(".").pop().toLowerCase();
Expand Down Expand Up @@ -74,7 +76,7 @@ export function PostCard({ post }) {
<div className="flex justify-between items-center py-4">
<img
className="w-12 rounded-full"
src="https://images.unsplash.com/photo-1585829365295-ab7cd400c167?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=870&q=80"
src={logoImg}
alt="img Logo"
/>
<div className="ml-3">
Expand All @@ -89,13 +91,13 @@ export function PostCard({ post }) {
<div>
{" "}
<button
className="bg-gray-400 hover:bg-sky-400 text-sm px-2 py-1 rounded-sm"
className="bg-gray-300 hover:bg-sky-300 text-sm px-2 py-1 rounded-sm transition duration-500 hover:shadow-md hover:translate-y-4"
onClick={() => navigate(`/posts/${post._id}`)}
>
Edit
</button>{" "}
<button
className="bg-gray-400 hover:bg-red-600 text-sm px-2 py-1 rounded-sm "
className="bg-gray-300 hover:bg-red-400 text-sm px-2 py-1 rounded-sm transition duration-500 hover:shadow-md hover:translate-y-4"
onClick={() => handleDelete(post._id)}
>
Delete
Expand Down
4 changes: 3 additions & 1 deletion src/components/PostCardUser.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import moment from "moment";
import { insertMedia } from "./PostCard";
import logoImg from "../Images/postimg.jpg"

export function PostCardUser({ post }) {
const normalDate = moment(post.createdAt).format("DD/MM/YYYY");
return (
Expand All @@ -8,7 +10,7 @@ export function PostCardUser({ post }) {
<div className="flex justify-between items-center py-4">
<img
className="w-12 rounded-full"
src="https://images.unsplash.com/photo-1585829365295-ab7cd400c167?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=870&q=80"
src={logoImg}
alt="logo"
/>
<div className="ml-3">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PostForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function PostForm() {
<input type="file" name="image" className="px-3 py-2 focus:outline-none rounded bg-gray-600 text-white w-full" onChange={(e)=> setFieldValue('image',e.target.files[0])}/>
<button
type="submit"
className="bg-indigo-600 hover:bg-indigo-500 px-4 py-2 rounded mt-2 text-white focus:outline-none disabled:bg-indigo-400"
className="bg-indigo-600 hover:bg-indigo-500 px-4 py-2 rounded mt-2 text-white focus:outline-none disabled:bg-indigo-400 animate-pulse"
disable={isSubmitting}
>
{isSubmitting ? <button
Expand Down