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

Apo 1022 seacoast search bar alignment #241

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 8 additions & 6 deletions packages/web-shared/components/Profile/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import themeGet from '@styled-system/theme-get';
import { logout, useAuth } from '../../providers/AuthProvider';
import authSteps from '../Auth/authSteps';

const Profile = ({ theme, handleCloseProfile, ...rest }) => {
const Profile = ({ theme, handleCloseProfile, size, ...rest }) => {
const { currentUser } = useCurrentUser();
const { currentChurch } = useCurrentChurch();

Expand Down Expand Up @@ -85,11 +85,13 @@ const Profile = ({ theme, handleCloseProfile, ...rest }) => {
_: '0%',
sm: 'xxl',
}}
width={{
_: '100%',
sm: '350px',
md: '520px',
}}
width={
size ?? {
_: '100%',
sm: '350px',
md: '520px',
}
}
>
<Box display="flex" alignItems="center" justifyContent="end">
<Styled.CloseIcon onClick={handleCloseProfile}>
Expand Down
2 changes: 1 addition & 1 deletion packages/web-shared/components/Profile/Profile.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Profile = withTheme(styled.div`
position: absolute;
transition: opacity 0.3s ease;
z-index: 9999;
right: 0;
right: -15px;

@media screen and (max-width: ${themeGet('breakpoints.sm')}) {
position: fixed;
Expand Down
4 changes: 3 additions & 1 deletion packages/web-shared/components/Profile/ProfileButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const ProfileButton = (props) => {
</Box>
)}
</Box>
{showProfile ? <Profile handleCloseProfile={() => setShowProfile(false)} /> : null}
{showProfile ? (
<Profile handleCloseProfile={() => setShowProfile(false)} size={props.popupSize} />
) : null}
</Box>
);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/web-shared/components/Searchbar/Searchbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const Searchbar = (props = {}) => {
</Styled.InterfaceWrapper>
</Styled.Interface>
<Box p={16}>
<ProfileButton />
<ProfileButton popupSize={searchState.searchProfileSize} />
</Box>
</Box>
<SearchResults autocompleteState={autocompleteState} autocomplete={autocompleteInstance} />
Expand Down
1 change: 1 addition & 0 deletions packages/web-shared/embeds/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const Main = ({ type }) => {
type={widget.dataset.type}
church={widget.dataset.church}
searchFeed={widget.dataset.searchFeed}
searchProfileSize={widget.dataset.searchProfileSize}
featureFeed={widget.dataset.featureFeed}
modal={widget.dataset.modal}
emptyPlaceholderText={widget.dataset.emptyPlaceholderText}
Expand Down
1 change: 1 addition & 0 deletions packages/web-shared/providers/AppProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function AppProvider(props = {}) {
<SearchProvider
church={props.church}
searchFeed={props.searchFeed}
searchProfileSize={props.searchProfileSize}
customPlaceholder={props.customPlaceholder}
>
<ModalProvider>
Expand Down
2 changes: 2 additions & 0 deletions packages/web-shared/providers/SearchProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const SearchDispatchContext = createContext();
const initialState = {
church: null,
searchFeed: null,
searchProfileSize: null,
customPlaceholder: null,
loading: true,
};
Expand Down Expand Up @@ -37,6 +38,7 @@ function SearchProvider(props = {}) {
...initialState, // spread the original initialState object
church: props.church, // add church to state
searchFeed: props.searchFeed, // add search feed id to state
searchProfileSize: props.searchProfileSize, // specify a custom width for the profile popup
customPlaceholder: props.customPlaceholder, // add search custom placeholder to state
});

Expand Down
4 changes: 4 additions & 0 deletions web-embeds/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ function App() {
const searchFeed = searchElement
? searchElement.getAttribute("data-search-feed")
: null;
const searchProfileSize = searchElement
? searchElement.getAttribute("data-search-profile-size")
: null;
const church = churchElement
? churchElement.getAttribute("data-church")
: null;
Expand Down Expand Up @@ -57,6 +60,7 @@ function App() {
<AppProvider
church={church}
searchFeed={searchFeed}
searchProfileSize={searchProfileSize}
customPlaceholder={customPlaceholder}
usePathRouter={usePathRouter}
>
Expand Down