Skip to content

Commit

Permalink
fix language and some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
devntv committed Jun 4, 2021
1 parent de0d5fa commit 79c3210
Show file tree
Hide file tree
Showing 12 changed files with 1,323 additions and 28 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.gs linguist-language=Javascript
*.css linguist-detectable=false
*.js linguist-detectable=true
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"watch:css": "postcss src/styles/tailwind.css -o src/styles/app.css --watch",
"react-scripts:start": "react-scripts start",
"start": "run-p watch:css react-scripts:start",
"build": "run-s build:css react-scripts:build",
"build": "react-scripts build",

"test": "react-scripts test",
"eject": "react-scripts eject",
"eslint-check": "eslint --print-config src/App.js | eslint-config-prettier-check"
Expand Down
1 change: 1 addition & 0 deletions public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
16 changes: 9 additions & 7 deletions src/components/profile/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function Header({
}, 2000);
}, [addBio]);

const { uid } = loggedUser.user;
const { uid } = loggedUser?.user;
const [openModal, setOpenModal] = useState(false);
const [isFollowingProfile, setIsFollowingProfile] = useState(false);
// check manager profile setting
Expand Down Expand Up @@ -126,7 +126,7 @@ export default function Header({
) : (
""
)}
{isUserLogged ? (
{/* {isUserLogged ? (
<div className="flex items-center justify-center flex-wrap ">
<button
type="button"
Expand All @@ -138,7 +138,7 @@ export default function Header({
</div>
) : (
""
)}
)} */}

{activeBtnFollowProfile && (
<>
Expand Down Expand Up @@ -253,8 +253,8 @@ export default function Header({
/>
)}
</div>
{isUserLogged && (
<div className="flex flex-col mt-8 -mb-4 items-center justify-center xs-res2:flex-row xs-res2:mt-8 md-res:mb-0 md-res2:mt-0 md-res2:ml-60 lg-res:ml-48">
{isUserLogged && (<>
<div className="flex flex-col mt-8 -mb-4 items-center justify-center xs-res2:flex-row xs-res2:mt-8 md-res:mb-0 md-res2:mt-0 md-res2:ml-44 lg-res:ml-44">
<button
onClick={handleBtnAddBio}
type="button"
Expand All @@ -267,7 +267,7 @@ export default function Header({
) : (
<>
<RiAddFill className="text-base font-bold sm-res:text-xl" />{" "}
Thêm tiểu sử{" "}
{!bioProfile ? 'Thêm tiểu sử':'Chỉnh sửa tiểu sử'}
</>
)}
</button>
Expand All @@ -278,13 +278,15 @@ export default function Header({
Một số tinh năng đang được phát triển
</button>
<a
href="https://github.com/devntv/dinhstagram-react"
href="https://github.com/devntv/dinhstagram-react/graphs/contributors" target='_blank' rel="noreferrer"
className="text-xs text-white bg-red-primary ml-2 border p-2 mt-2 rounded flex items-center"
>
trở thành Contributors{" "}
<BsArrowRight className="text-lg font-bold ml-1" />{" "}
</a>
</div>
{/* {addBio && <input type="text" placeholder="Nhập bio" className='border'/>} */}
</>
)}

<div className="mt-10 flex text-sm items-center w-auto justify-center -mb-8 border-t border-gray-primary relative mx-0 sm-res:hidden">
Expand Down
13 changes: 7 additions & 6 deletions src/components/profile/photos.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export default function Photos({ photos, profile:{ userId: profileUserId, follow
const { user: loggedInUser } = React.useContext(UserContext)
const { user } = useUser(loggedInUser?.uid);
const loggedUser = useAuthListener();
const { uid } = loggedUser.user;
console.log(loggedUser);
const { uid } = loggedUser?.user;
const isUserLogged = profileUserId === uid;
return (
<>
Expand All @@ -28,7 +29,7 @@ export default function Photos({ photos, profile:{ userId: profileUserId, follow
<div
className={`${
photos.length > 0
? "grid grid-cols-3 gap-7 mt-4 w-auto"
? "grid grid-cols-3 h-full mt-2 w-auto object-cover bg-center"
: "flex items-center justify-center"
}`}
>
Expand All @@ -38,14 +39,14 @@ export default function Photos({ photos, profile:{ userId: profileUserId, follow
</>
) : photos.length > 0 ? (
photos.map((photo) => (
<div key={photo.docId} className="relative group object-cover">
<div key={photo.docId} className="relative group object-cover mx-1 my-1">
<img
src={photo.imageSrc}
alt={photo.caption}
className="h-80 w-auto object-cover bg-fixed rounded overflow-hidden bg-center bg-contain"
className=" h-36 w-full object-cover bg-fixed rounded-lg overflow-hidden bg-center bg-contain sm-res:h-72"
/>
<div className="absolute hidden bottom-0 left-0 bg-gray-200 z-10 w-full justify-center items-center h-full bg-black-faded group-hover:flex ">
<p className="flex items-center text-white font-bold mr-8">
<div className="absolute bottom-0 left-0 bg-gray-200 z-10 w-full justify-center items-center h-full rounded-lg bg-black-faded hidden group-hover:flex">
<p className="flex items-center text-white font-bold minium2:mr-2 sm-res:mr-6 md-res2:mr-10">
<svg
xmlns="http://www.w3.org/2000/svg"
className="mr-1 w-8"
Expand Down
3 changes: 0 additions & 3 deletions src/components/sidebar/view-allSuggessted.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ export default function ViewAllSuggested() {
</div>
</div>
</div>
<div className='md-res:mb-0 mb-14'>
<Footer />
</div>
<HeaderMobile />
</>
);
Expand Down
1 change: 0 additions & 1 deletion src/pages/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default function Dashboard({ user: loggedInuser }) {
<Timeline />
<div>
<Sidebar />
<HeaderMobile />
</div>
</div>
{/* reponsive Mobile */}
Expand Down
1 change: 0 additions & 1 deletion src/pages/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ export default function login() {
className="relative font-semibold bottom-10 right-2 text-sm cursor-pointer focus:outline-none"
onClick={handleDisplay}
> {password === '' ? '' : 'Hiển thị' && displayPass ? 'Hiển thị' : 'Ẩn'}

</button>
</div>

Expand Down
6 changes: 4 additions & 2 deletions src/pages/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function Profile() {
async function checkUserExists() {
setLoadPhotosUser(true)
const [user] = await getUserByUsername(username)
console.log(user)

if (user?.userId) {
setUser(user)
// setUserExists(true)
Expand Down Expand Up @@ -69,5 +69,7 @@ export default function Profile() {
</div>
<HeaderMobile />
</div>
) : null
) : (
<div>Hãy đăng nhập</div>
)
}
2 changes: 1 addition & 1 deletion src/services/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function getUserByUsername(username) {
...item.data(),
docId: item.id
}))
console.log(user);

return user.length > 0 ? user : []
}

Expand Down
Loading

0 comments on commit 79c3210

Please sign in to comment.