mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-17 02:01:29 +10:00
- implement lists
- implement generic sections - implement list actions - implement error handlers
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
export const getModalText = (isEditMode, type) => {
|
||||
return isEditMode ? `Edit ${type}` : `Create New ${type}`;
|
||||
return isEditMode ? `Edit ${type}` : `Add ${type}`;
|
||||
};
|
||||
|
||||
export const transformCollectionSnapshot = (snapshot, setData) => {
|
||||
@ -7,3 +7,12 @@ export const transformCollectionSnapshot = (snapshot, setData) => {
|
||||
snapshot.forEach((doc) => data.push(doc.data()));
|
||||
setData(data);
|
||||
};
|
||||
|
||||
export const handleKeyDown = (event, action) => {
|
||||
event.which === 13 && action();
|
||||
};
|
||||
|
||||
export const isFileImage = (file) => {
|
||||
const acceptedImageTypes = ["image/jpeg", "image/png"];
|
||||
return file && acceptedImageTypes.includes(file["type"]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user