Skip to content

Commit

Permalink
updating layout for suggestions.
Browse files Browse the repository at this point in the history
retrieve email from functions
  • Loading branch information
Andi-IM committed Sep 12, 2023
1 parent 8d7e343 commit 0d2ec3c
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 0d2ec3c

Please sign in to comment.