-
Notifications
You must be signed in to change notification settings - Fork 4
Feature/add sponsor services components #212
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
Changes from all commits
657a523
9219496
d356921
c01f05e
345dcec
d8329b7
2c32afb
ce1a829
9d13f25
ca42409
b9ab764
0461296
203ebed
50f7a0d
a948832
746276b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /** | ||
| * Copyright 2026 OpenStack Foundation | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * */ | ||
|
|
||
| import React from "react"; | ||
| import { Button } from "@mui/material"; | ||
| import NotificationsIcon from "@mui/icons-material/Notifications"; | ||
|
|
||
| const AlertButton = ({ label, onClick }) => ( | ||
| <Button | ||
| endIcon={<NotificationsIcon sx={{ fontSize: 16 }} />} | ||
| onClick={onClick} | ||
| color="warning" | ||
| variant="outlined" | ||
| size="large" | ||
| sx={{ borderRadius: 92 }} | ||
| > | ||
| {label} | ||
| </Button> | ||
| ); | ||
|
|
||
| export default AlertButton; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /** | ||
| * Copyright 2026 OpenStack Foundation | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * */ | ||
|
|
||
| import React from "react"; | ||
| import PropTypes from "prop-types"; | ||
| import T from "i18n-react"; | ||
| import { Divider, IconButton, Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from "@mui/material"; | ||
| import CloseIcon from "@mui/icons-material/Close"; | ||
|
|
||
| const AlertModal = ({ title, message, open, onClose }) => { | ||
| return ( | ||
| <Dialog open={open} onClose={onClose} maxWidth="sm" fullWidth> | ||
| <DialogTitle>{title}</DialogTitle> | ||
| <IconButton | ||
| aria-label="close" | ||
| onClick={onClose} | ||
| sx={(theme) => ({ | ||
| position: "absolute", | ||
| right: 8, | ||
| top: 8, | ||
| color: theme.palette.grey[500] | ||
| })} | ||
| > | ||
| <CloseIcon /> | ||
| </IconButton> | ||
| <Divider /> | ||
| <DialogContent> | ||
| <DialogContentText>{message}</DialogContentText> | ||
| </DialogContent> | ||
| <Divider /> | ||
| <DialogActions> | ||
| <Button onClick={onClose} variant="contained" fullWidth> | ||
| {T.translate("general.ok")} | ||
| </Button> | ||
| </DialogActions> | ||
| </Dialog> | ||
| ); | ||
| }; | ||
|
|
||
| AlertModal.propTypes = { | ||
| title: PropTypes.string.isRequired, | ||
| message: PropTypes.string.isRequired, | ||
| open: PropTypes.bool.isRequired, | ||
| onClose: PropTypes.func.isRequired | ||
| }; | ||
|
|
||
| export default AlertModal; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /** | ||
| * Copyright 2026 OpenStack Foundation | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * */ | ||
|
|
||
| import React, { useState } from "react"; | ||
| import T from "i18n-react"; | ||
| import {Button, Box} from '@mui/material'; | ||
| import styles from "./styles.module.scss" | ||
|
|
||
| const AuthButton = ({ isLoggedUser, doLogin, initLogOut, picture }) => { | ||
| const [showLogOut, setShowLogOut] = useState(false); | ||
|
|
||
| const toggleLogOut = () => { | ||
| setShowLogOut(!showLogOut); | ||
| }; | ||
|
|
||
| if (isLoggedUser) { | ||
| return ( | ||
| <div className={styles.userMenu} onClick={toggleLogOut}> | ||
| <div | ||
| className={styles.profilePic} | ||
| style={{ backgroundImage: `url(${picture})` }} | ||
| /> | ||
| {showLogOut && ( | ||
| <Button | ||
| className={styles.logout} | ||
| variant="contained" | ||
| size="small" | ||
| color="secondary" | ||
| onClick={() => { | ||
| initLogOut(); | ||
| }} | ||
| > | ||
| {T.translate("buttons.sign_out")} | ||
| </Button> | ||
| )} | ||
| </div> | ||
|
Comment on lines
+26
to
+46
|
||
| ); | ||
| } | ||
| return ( | ||
| <Box className={styles.login}> | ||
| <Button | ||
| variant="contained" | ||
| size="small" | ||
| color="secondary" | ||
| onClick={() => { | ||
| doLogin(); | ||
| }} | ||
| > | ||
| {T.translate("buttons.log_in")} | ||
| </Button> | ||
| </Box> | ||
| ); | ||
|
|
||
| }; | ||
|
|
||
| export default AuthButton; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| .userMenu { | ||
| position: absolute; | ||
| top: 12px; | ||
| right: 34px; | ||
| height: 40px; | ||
| width: 140px; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .login { | ||
| width: 100%; | ||
| text-align: right; | ||
| } | ||
|
|
||
| .logout { | ||
| top: 4px; | ||
| right: 4px; | ||
| } | ||
|
|
||
| .profilePic { | ||
| height: 40px; | ||
| width: 40px; | ||
| border: 1px solid #afafaf; | ||
| border-radius: 20px; | ||
| overflow: hidden; | ||
| float: right; | ||
| background-size: cover; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| /** | ||
| * Copyright 2026 OpenStack Foundation | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * */ | ||
|
|
||
| import React from "react"; | ||
| import { Button, Box } from "@mui/material"; | ||
| import T from "i18n-react"; | ||
|
|
||
| const CartButton = ({ itemCount, onClick, sx, disabled }) => { | ||
| return ( | ||
| <Button | ||
| endIcon={ | ||
| !disabled && ( | ||
| <Box | ||
| component="div" | ||
| sx={{ | ||
| backgroundColor: "white", | ||
| color: "primary.main", | ||
| fontWeight: 700, | ||
| fontSize: "12px !important", | ||
| minWidth: "20px", | ||
| height: "20px", | ||
| borderRadius: "10px", | ||
| marginLeft: "4px", | ||
| marginRight: "2px" | ||
| }} | ||
| > | ||
| {itemCount} | ||
| </Box> | ||
| ) | ||
| } | ||
| onClick={onClick} | ||
| color="primary" | ||
| variant="contained" | ||
| size="large" | ||
| sx={{ borderRadius: 92, ...sx }} | ||
| disabled={disabled} | ||
| > | ||
| {T.translate("buttons.my_cart")} | ||
| </Button> | ||
| ); | ||
| }; | ||
|
|
||
| export default CartButton; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /** | ||
| * Copyright 2026 OpenStack Foundation | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * */ | ||
|
|
||
| import React from "react"; | ||
| import PropTypes from "prop-types"; | ||
| import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle} from "@mui/material"; | ||
| import T from "i18n-react"; | ||
|
|
||
| const ConfirmDeleteDialog = ({ open, onClose, onConfirm, message }) => { | ||
| return ( | ||
| <Dialog | ||
| open={open} | ||
| onClose={onClose} | ||
| aria-labelledby="alert-dialog-title" | ||
| aria-describedby="alert-dialog-description" | ||
| > | ||
| <DialogTitle id="alert-dialog-title"> | ||
| {T.translate("alerts.confirm_delete_title")} | ||
| </DialogTitle> | ||
| <DialogContent> | ||
| <DialogContentText id="alert-dialog-description"> | ||
| {message || T.translate("alerts.confirm_delete")} | ||
| </DialogContentText> | ||
| </DialogContent> | ||
| <DialogActions> | ||
| <Button onClick={onClose} color="primary"> | ||
| {T.translate("general.cancel")} | ||
| </Button> | ||
| <Button onClick={onConfirm} color="error" autoFocus> | ||
| {T.translate("general.delete")} | ||
| </Button> | ||
| </DialogActions> | ||
| </Dialog> | ||
| ); | ||
| }; | ||
|
|
||
| ConfirmDeleteDialog.propTypes = { | ||
| open: PropTypes.bool.isRequired, | ||
| onClose: PropTypes.func.isRequired, | ||
| onConfirm: PropTypes.func.isRequired, | ||
| message: PropTypes.string | ||
| }; | ||
|
|
||
| ConfirmDeleteDialog.defaultProps = { | ||
| message: "" | ||
| }; | ||
|
|
||
| export default ConfirmDeleteDialog; |
Uh oh!
There was an error while loading. Please reload this page.