Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: photo #32

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/api/review/reviewApiIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ export const createReview = async (
createReviewDto: CreateReviewDto,
imagePrefix: string,
restaurantID: string,
photoCategory: string
photoCategory: string,
fileExtension?: string
): Promise<Review> => {
return apiClient.post(
"",
{ createReviewDto, imagePrefix, restaurantID },
{ createReviewDto, imagePrefix, restaurantID, fileExtension },
{ params: { photoCategory } }
);
};
Expand Down
30 changes: 0 additions & 30 deletions src/components/input/FileInput.tsx

This file was deleted.

37 changes: 0 additions & 37 deletions src/components/input/NumberInput.tsx

This file was deleted.

29 changes: 0 additions & 29 deletions src/components/input/OpeningHoursInput.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions src/components/input/SearchInput.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions src/components/input/SelectInput.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions src/components/input/TextInput.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions src/components/input/TextareaInput.tsx

This file was deleted.

10 changes: 5 additions & 5 deletions src/components/utils/inputs/FileInput.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
type FileInputProps = {
interface FileInputProps {
label?: string;
placeholder: string;
value?: string | number;
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
type: React.HTMLInputTypeAttribute;
className: string;
};
}

const FileInput = ({
const FileInput: React.FC<FileInputProps> = ({
label,
placeholder,
onChange,
type,
className,
}: FileInputProps) => {
}) => {
return (
<div className="flex flex-col gap-1">
{label && <label className="text-sm font-semibold">{label}</label>}
<input
className={className}
className={`border border-gray-400 rounded-md p-2 ${className}`}
type={type}
placeholder={placeholder}
onChange={onChange}
Expand Down
10 changes: 5 additions & 5 deletions src/components/utils/inputs/NumberInput.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
type NumberInputProps = {
interface NumberInputProps {
label: string;
placeholder: string;
value: number;
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
step: string;
min?: number;
max?: number;
};
}

const TextInput = ({
const NumberInput: React.FC<NumberInputProps> = ({
label,
placeholder,
value,
onChange,
step,
min,
max,
}: NumberInputProps) => {
}) => {
return (
<div className="flex flex-col">
<label>{label}</label>
Expand All @@ -34,4 +34,4 @@ const TextInput = ({
);
};

export default TextInput;
export default NumberInput;
13 changes: 9 additions & 4 deletions src/components/utils/inputs/OpeningHoursInput.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";

type DateInputProps = {
interface OpeningHoursInputProps {
label: string;
placeholder: string;
value: Date;
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
};
}

const DateInput = ({ label, placeholder, value, onChange }: DateInputProps) => {
const OpeningHoursInput: React.FC<OpeningHoursInputProps> = ({
label,
placeholder,
value,
onChange,
}) => {
return (
<div className="flex flex-col">
<label>{label}</label>
Expand All @@ -26,4 +31,4 @@ const DateInput = ({ label, placeholder, value, onChange }: DateInputProps) => {
);
};

export default DateInput;
export default OpeningHoursInput;
21 changes: 13 additions & 8 deletions src/components/utils/inputs/SearchInput.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
import { IoSearch } from "react-icons/io5";

type SearchInputProps = {
interface SearchInputProps {
placeholder?: string;
value: string;
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
type: React.HTMLInputTypeAttribute;
};
}

const SearchInput: React.FC<SearchInputProps> = (props) => {
const SearchInput: React.FC<SearchInputProps> = ({
placeholder,
value,
onChange,
type,
}) => {
return (
<div className="flex items-center h-12 w-full">
<input
className="border border-gray-400 rounded-tl-md rounded-bl-md px-4 outline-none h-full w-full"
type={props.type}
placeholder={props.placeholder || ""}
value={props.value}
onChange={props.onChange}
type={type}
placeholder={placeholder || ""}
value={value}
onChange={onChange}
/>
<button
type="submit"
className="bg-gray-700 h-full w-14 flex justify-center items-center rounded-tr-md rounded-br-md"
className="bg-gray-700 h-full w-14 flex justify-center items-center rounded-tr-md rounded-br-md hover:scale-110 hover:rounded-sm duration-500"
>
<IoSearch color="#FFFFFF" />
</button>
Expand Down
Loading