-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #315 from NIAEFEUP/feature/collapsable-quick-edit-…
…options-305 Quick offer edit actions collapsable in company offers management widget
- Loading branch information
Showing
10 changed files
with
2,237 additions
and
5,468 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/components/Company/Offers/Manage/CollapsedQuickOfferEdit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React, { useState } from "react"; | ||
import PropTypes from "prop-types"; | ||
import { Box, Button, Collapse, Typography } from "@material-ui/core"; | ||
import { KeyboardArrowDown, KeyboardArrowUp } from "@material-ui/icons"; | ||
import { QuickOfferEditForm } from "./QuickOfferEditForm"; | ||
|
||
const CollapsedQuickOfferEdit = ({ offerId, isMobile }) => { | ||
const [collapse, setCollapse] = useState(false); | ||
|
||
return isMobile ? ( | ||
<> | ||
<Box | ||
display="flex" | ||
alignSelf="center" | ||
alignItems="center" | ||
flexDirection="row" | ||
> | ||
<Typography align="center">Quick Edit Offer</Typography> | ||
<Button | ||
onClick={() => setCollapse(!collapse)} | ||
size="small" | ||
margin="dense" | ||
endIcon={collapse ? <KeyboardArrowUp /> : <KeyboardArrowDown />} | ||
/> | ||
</Box> | ||
<Collapse in={collapse}> | ||
<QuickOfferEditForm offerId={offerId} /> | ||
</Collapse> | ||
</> | ||
) : ( | ||
<QuickOfferEditForm offerId={offerId} showTitle={true} /> | ||
); | ||
}; | ||
|
||
CollapsedQuickOfferEdit.propTypes = { | ||
offerId: PropTypes.string.isRequired, | ||
isMobile: PropTypes.bool.isRequired, | ||
}; | ||
|
||
export default CollapsedQuickOfferEdit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.