-
Notifications
You must be signed in to change notification settings - Fork 0
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 #531 from culturecreates/feature/issue-482
feat: Reuse the components from the add event page for the search dro…
- Loading branch information
Showing
8 changed files
with
240 additions
and
25 deletions.
There are no files selected for viewing
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,27 @@ | ||
import React from 'react'; | ||
import './entityCard.css'; | ||
import ArtsDataLink from '../../Tags/ArtsDataLink/ArtsDataLink'; | ||
import { LinkOutlined } from '@ant-design/icons'; | ||
|
||
const EntityCard = (props) => { | ||
const { title, description, artsDataLink, Logo } = props; | ||
return ( | ||
<div className="search-option-entity-card"> | ||
<div className="image-container"> | ||
<Logo /> | ||
</div> | ||
<div className="text-container"> | ||
<div className="title">{title}</div> | ||
<div className="description">{description}</div> | ||
</div> | ||
<div className="link-container"> | ||
<ArtsDataLink onClick={() => window.open(`${artsDataLink}`, '_blank', 'noopener,noreferrer')}> | ||
<span style={{ textDecoration: 'underline' }}>Source</span> | ||
<LinkOutlined /> | ||
</ArtsDataLink> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default EntityCard; |
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,56 @@ | ||
.search-option-entity-card { | ||
min-height: 56px; | ||
max-height: 100px; | ||
padding: 8px 0; | ||
gap: 8px; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.search-option-entity-card .image-container { | ||
height: 40px; | ||
width: 40px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 4px; | ||
background-color: rgb(227, 232, 255); | ||
} | ||
|
||
.search-option-entity-card .text-container { | ||
flex-grow: 1; | ||
padding: 0 5px; | ||
} | ||
|
||
/* .search-option-entity-card .image-container img { | ||
width: 100%; | ||
object-fit: contain; | ||
height: 100%; | ||
} */ | ||
|
||
.search-option-entity-card .title { | ||
font-weight: 700; | ||
font-size: 16px; | ||
color: #222732; | ||
} | ||
|
||
.search-option-entity-card .description { | ||
font-weight: 400; | ||
font-size: 12px; | ||
color: #646d7b; | ||
} | ||
|
||
.search-option-entity-card .link-btn-container { | ||
border-radius: 4px; | ||
padding: 4px 8px; | ||
width: auto; | ||
color: #0f0e98; | ||
background-color: #e3e8ff; | ||
border: 0px; | ||
margin: 0px; | ||
} | ||
|
||
.search-option-entity-card .link-btn-container:first-child { | ||
display: flex; | ||
gap: 8px; | ||
} |
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
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
76 changes: 76 additions & 0 deletions
76
src/pages/Dashboard/SearchOrganizations/CreateNewOrgainzation.jsx
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,76 @@ | ||
import { Popover } from 'antd'; | ||
import React, { useEffect, useState } from 'react'; | ||
import EntityCard from '../../../components/Card/Common/EntityCard'; | ||
import NoContent from '../../../components/NoContent/NoContent'; | ||
import EventsSearch from '../../../components/Search/Events/EventsSearch'; | ||
import NewEntityLayout from '../../../layout/CreateNewEntity/NewEntityLayout'; | ||
import { ReactComponent as Logo } from '../../../assets/icons/organization-light.svg'; | ||
import './createNew.css'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
function CreateNewOrgainzation() { | ||
const { t } = useTranslation(); | ||
|
||
const [isPopoverOpen, setIsPopoverOpen] = useState(false); | ||
const [organizationList, setOrganizationList] = useState([]); | ||
const [selectedOrganizers, setSelectedOrganizers] = useState([]); | ||
|
||
useEffect(() => { | ||
setOrganizationList([]); | ||
}, []); | ||
|
||
return ( | ||
<NewEntityLayout | ||
heading={t('dashboard.organization.createNew.search.title')} | ||
entityName={t('dashboard.organization.createNew.search.searchbarHeader')} | ||
text={t('dashboard.organization.createNew.search.text')}> | ||
<div className="search-bar-organization"> | ||
<Popover | ||
open={isPopoverOpen} | ||
arrow={false} | ||
overlayClassName="event-popover" | ||
placement="bottom" | ||
onOpenChange={(open) => setIsPopoverOpen(open)} | ||
autoAdjustOverflow={false} | ||
getPopupContainer={(trigger) => trigger.parentNode} | ||
trigger={['click']} | ||
content={ | ||
<div> | ||
<div className="search-scrollable-content"> | ||
{organizationList?.length > 0 ? ( | ||
organizationList?.map((organizer, index) => ( | ||
<div | ||
key={index} | ||
className="search-popover-options" | ||
onClick={() => { | ||
setSelectedOrganizers([...selectedOrganizers, organizer]); | ||
setIsPopoverOpen(false); | ||
}}> | ||
<EntityCard | ||
title={organizer.organizationName} | ||
description={organizer.smallDescription} | ||
artsDataLink={organizer.dummyLink} | ||
Logo={Logo} | ||
/> | ||
</div> | ||
)) | ||
) : ( | ||
<NoContent /> | ||
)} | ||
</div> | ||
</div> | ||
}> | ||
<EventsSearch | ||
style={{ borderRadius: '4px' }} | ||
placeHolder="Search organizations" | ||
onClick={() => { | ||
setIsPopoverOpen(!isPopoverOpen); | ||
}} | ||
/> | ||
</Popover> | ||
</div> | ||
</NewEntityLayout> | ||
); | ||
} | ||
|
||
export default CreateNewOrgainzation; |
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,23 @@ | ||
.search-bar-organization .event-popover .ant-popover-arrow { | ||
display: none; | ||
} | ||
|
||
.search-bar-organization .event-popover { | ||
width: 100%; | ||
padding-top: 0; | ||
padding-bottom: 0; | ||
} | ||
|
||
.search-bar-organization .ant-popover-inner { | ||
filter: drop-shadow(0px 8px 32px rgba(0, 0, 0, 0.2)); | ||
} | ||
|
||
.search-bar-organization .event-popover .ant-popover-inner-content { | ||
padding: 0px; | ||
} | ||
|
||
.search-bar-organization .ant-popover-inner-content .search-scrollable-content { | ||
max-height: 350px; | ||
overflow-y: scroll; | ||
padding: 0px 16px 0 8px; | ||
} |