Skip to content

Commit

Permalink
comments will be shown only to login users
Browse files Browse the repository at this point in the history
  • Loading branch information
trainto committed Jan 17, 2024
1 parent 2b0d45c commit ab313f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/places/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default function Modal() {
<div className="text-lg pb-2 px-1 font-bold text-brand1">Places</div>

<div
className="border-t border-gray-500 pt-2 pb-3 px-2"
// className="border-t border-gray-500 pt-2 pb-3 px-2"
className="pt-2 pb-3 px-2 text-gray-300"
dangerouslySetInnerHTML={{ __html: info?.msg ?? '' }}
></div>

Expand Down
5 changes: 5 additions & 0 deletions src/components/places/photo-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default function PhotoEditor({
}, [files]);

useEffect(() => {
if (urls.length !== files.length) {
return;
}

let check = true;
for (let i = 0; i < files.length; i += 1) {
if (!urls[i]) {
Expand All @@ -44,6 +48,7 @@ export default function PhotoEditor({
}

if (check) {
console.log(urls);
setReady(true);
}
}, [files.length, urls]);
Expand Down
5 changes: 5 additions & 0 deletions src/components/places/place.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const Place = ({ place, priority }: { place: Place; priority: boolean }) => {
};

const handleCommentsClick = () => {
if (userInfo == null) {
dispatch('modal', { msg: 'Please sign in to cotinue!' });
return;
}

dispatch('layer', {
node: <Comments place={place} />,
containerClassName: 'w-full sm:w-1/3',
Expand Down

0 comments on commit ab313f6

Please sign in to comment.