Skip to content

Commit

Permalink
Merge pull request #13 from Andi-IM/feature/only_me
Browse files Browse the repository at this point in the history
updating layout for suggestions.
  • Loading branch information
Andi-IM authored Sep 12, 2023
2 parents 8d7e343 + 0d2ec3c commit 1af8be4
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 237 deletions.
33 changes: 11 additions & 22 deletions src/components/Suggestion/ModalDetailImgSuggestion.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
import { Col, Image, Modal, Row } from "antd";
import DataDetailSuggestion from "./DataDetailSuggestion";
import {Col, Image, Modal, Row} from "antd";

const ModalDetailImgSuggestion = ({ open, setOpen, objDetailImg }) => {
return (
<Modal open={open} onCancel={() => setOpen(false)} title="Deskripsi Foto">
<Row gutter={16} align="middle">
<Col span={12}>
<Image />
</Col>
<Col span={12}>
<DataDetailSuggestion
label="Description"
value={objDetailImg?.description}
/>
<DataDetailSuggestion
label="Attribution"
value={objDetailImg?.attribution}
/>
</Col>
</Row>
</Modal>
);
const ModalDetailImgSuggestion = ({open, setOpen, objDetailImg}) => {
return (
<Modal open={open} onCancel={() => setOpen(false)} title="Deskripsi Foto">
<Row gutter={16} align="middle">
<Col span={12}>
<Image src={objDetailImg?.url}/>
</Col>
</Row>
</Modal>
);
};
export default ModalDetailImgSuggestion;
17 changes: 17 additions & 0 deletions src/helpers/getUserById.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {getFunctions, httpsCallable} from "firebase/functions";
import {message} from "antd";

const getUserById = async (id) => {
try {
const functions = getFunctions();
const request = httpsCallable(functions, 'getUserById');
return await request({userId: id});
} catch (error) {
// Getting the Error details.
return message.error({
content: `Error! : ${error.message}`
})
}
}

export default getUserById;
Loading

0 comments on commit 1af8be4

Please sign in to comment.