-
Notifications
You must be signed in to change notification settings - Fork 1
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
Admin drink page #87
base: main
Are you sure you want to change the base?
Admin drink page #87
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Só uma questão nunca abram um PR de 36 arquivos isso é demais, encontrou problemas em vários componentes? Primeiro que então revisaram o PR errado, segundo, abre uma branch hotfix para corrigir o BO.
@@ -1,4 +1,4 @@ | |||
import { ReactNode } from "react"; | |||
|
|||
export type IconsTypes = ReactNode & 'block' | 'sports_bar' | 'lock_open' | 'info' | 'schedule' | 'school' | 'flag' | 'logout' ; | |||
export type IconsTypes = ReactNode & 'block' | 'sports_bar' | 'lock_open' | 'info' | 'schedule' | 'school' | 'flag' | 'logout' | 'expand_more' | 'segment' | 'filter_list' | 'search' | '❤' ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não passa um emoji como type pfv
height: 70px; | ||
min-height: 70px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literalmente não teve pq fazer isso...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o ideal é voltar, só utilizar min-height em casos de usar % no height. Se for para definir um height padrão, só use a propriedade height.
import styled from "styled-components"; | ||
import User from "../../models/UserModel"; | ||
import Card from "./Card"; | ||
import {useState} from "react"; | ||
import {createPortal} from "react-dom"; | ||
import UserManagementModal from "../organisms/UserManagementModal"; | ||
|
||
|
||
interface ListUsersInterface { | ||
listUsers: Array<User>; | ||
} | ||
|
||
const ModalWrapper = styled.div` | ||
background-color: rgba(0, 0, 0, 0.5); | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
`; | ||
|
||
const ListUsersStyle = styled.div` | ||
display: grid; | ||
grid-template-columns: repeat(4, 1fr); | ||
grid-auto-rows: minmax(100px, auto); | ||
column-gap: 56px; | ||
row-gap: 36px; | ||
padding-top: 360px; | ||
`; | ||
|
||
const ListUsers = ({ listUsers }: ListUsersInterface) => { | ||
|
||
const ActionModal = (userEmail: string, action: string, setShowModal: any) => { | ||
console.log(action); | ||
return ( | ||
<ModalWrapper> | ||
<UserManagementModal | ||
userEmail={userEmail} | ||
action={action} | ||
setShowModal={setShowModal} | ||
/> | ||
</ModalWrapper> | ||
); | ||
}; | ||
|
||
const [showModal, setShowModal] = useState(false); | ||
const [modalContent, setModalContent] = useState<React.ReactElement | null>(null); | ||
|
||
return ( | ||
<ListUsersStyle> | ||
{ | ||
listUsers.map(function (user: User) { | ||
return ( | ||
<Card | ||
cardTitle={user.email!} | ||
cardType="user" | ||
userIndicationQuantity={3} | ||
height="291px" | ||
width="227px" | ||
backgroundImage="https://viciados.net/wp-content/uploads/2022/11/Naruto-Shippuden-Boruto-2023.webp" | ||
userBlock={false} | ||
onBlockUser={ () => { | ||
setModalContent(ActionModal(user.email!, 'block', setShowModal)); | ||
setShowModal(true); | ||
} } | ||
onDrinkRecommendation={() => { }} | ||
onUnlockUser={ () => { | ||
setModalContent(ActionModal(user.email!, 'unlock', setShowModal)); | ||
setShowModal(true); | ||
} } | ||
/> | ||
); | ||
}) | ||
} | ||
|
||
{showModal && createPortal(modalContent, document.body)} | ||
</ListUsersStyle > | ||
) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esse componente tb vai ser usar na lista de drinks pq não troca ro nome dele e das variaveis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inclusive o Modal foi oq eu falei, da pra deixar sendo tanto pra usuário como pra drink
//useEffect(() => { | ||
//console.log(categoryQuery); // replace with back end req | ||
//}, [categoryQuery]); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mata
|
||
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Muito espaçamento
const ListUserTemplate = () => { | ||
let maxCount = 0; | ||
const [listUsersData, setlistUsersData] = useState<Array<User>>([]); | ||
const [isLoading, setIsLoading] = useState<boolean>(false); | ||
|
||
const showMoreUsers = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pq krls isso existe se n ta usando em nenhum lugar?
const ListUsers = ({ listUsers }: ListUsersInterface) => { | ||
|
||
const ActionModal = (userEmail: string, action: string, setShowModal: any) => { | ||
console.log(action); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mata
` | ||
|
||
const pass = () => { | ||
console.log('aaa') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mata
<ControlsContainer> | ||
{(type==="drink")&&( | ||
<Dropdown | ||
label={categoryQuery} | ||
icon={'segment'} | ||
options={categories} | ||
width='238px' | ||
onSelect={(category) => setCategoryQuery(category)} | ||
/> | ||
)} | ||
<StringInput | ||
value={nameQuery} | ||
onChange={(event) => setNameQuery(event.target.value)} | ||
height='58px' | ||
width='499px' | ||
borderRadius='8px' | ||
hasSearchButton | ||
onSearch={() => { }} // replace with back end req | ||
/> | ||
{(type==="drink")&&( | ||
<Dropdown | ||
label={'Filtrar'} | ||
icon={'filter_list'} | ||
options={[]} | ||
onSelect={(option) => { }} | ||
/> | ||
)} | ||
</ControlsContainer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transforma isso num componente Search lá nos organismos
…nto feature/admin-drink-page
…nto feature/admin-drink-page
…nto feature/admin-drink-page
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
Types of changes
What types of changes does your code introduce to <repo_name>?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...