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

Converted save image button #378

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Changes from 1 commit
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
53 changes: 32 additions & 21 deletions frontend/src/pages/ApartmentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import { getAverageRating } from '../utils/average';
import { colors } from '../colors';
import clsx from 'clsx';
import { sortReviews } from '../utils/sortReviews';
import savedIcon from '../assets/filled-large-saved-icon.png';
import unsavedIcon from '../assets/unfilled-large-saved-icon.png';
import savedIcon from '../assets/saved-icon-filled.svg';
import unsavedIcon from '../assets/saved-icon-unfilled.svg';
import MapModal from '../components/Apartment/MapModal';
import DropDownWithLabel from '../components/utils/DropDownWithLabel';

Expand Down Expand Up @@ -77,9 +77,6 @@ const useStyles = makeStyles((theme) => ({
container: {
marginTop: '20px',
},
root: {
borderRadius: '10px',
},
expand: {
transform: 'rotate(0deg)',
marginLeft: 'auto',
Expand All @@ -88,22 +85,22 @@ const useStyles = makeStyles((theme) => ({
expandOpen: {
transform: 'rotate(180deg)',
},
dateText: {
color: colors.gray1,
},
button: {
textTransform: 'none',
'&.Mui-disabled': {
color: 'inherit',
saveButton: {
backgroundColor: 'transparent',
width: '107px',
margin: '10px 16px',
borderRadius: '30px',
border: '2px solid',
fontSize: '15px',
borderColor: colors.red1,
'&:focus': {
borderColor: `${colors.red1} !important`,
},
},
horizontalLine: {
borderTop: '1px solid #C4C4C4',
width: '95%',
marginTop: '20px',
borderLeft: 'none',
borderRight: 'none',
borderBottom: 'none',
bookmarkRibbon: {
width: '19px',
height: '25px',
marginRight: '10px',
},
}));

Expand Down Expand Up @@ -174,6 +171,8 @@ const ApartmentPage = ({ user, setUser }: Props): ReactElement => {
container,
expand,
expandOpen,
saveButton,
bookmarkRibbon,
} = useStyles();

// Set the page title based on whether apartment data is loaded.
Expand Down Expand Up @@ -438,7 +437,7 @@ const ApartmentPage = ({ user, setUser }: Props): ReactElement => {
)}

<Grid item style={{ marginLeft: 'auto' }}>
<IconButton
{/* <IconButton
disableRipple
onClick={handleSaveToggle}
style={{
Expand All @@ -451,7 +450,19 @@ const ApartmentPage = ({ user, setUser }: Props): ReactElement => {
alt={isSaved ? 'Saved' : 'Unsaved'}
style={{ width: '107px', height: '43px' }}
/>
</IconButton>
</IconButton> */}
<Button
disableRipple
onClick={handleSaveToggle}
className={saveButton}
color="primary"
variant="outlined"
fullWidth
disableElevation
>
<img src={isSaved ? saved : unsaved} className={bookmarkRibbon} />
{isSaved ? 'Saved' : 'Save'}
</Button>
<Button
color="primary"
className={reviewButton}
Expand Down
Loading