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

Home - Sticky Nav Bar #2

Open
aryamankha opened this issue Oct 11, 2022 · 12 comments
Open

Home - Sticky Nav Bar #2

aryamankha opened this issue Oct 11, 2022 · 12 comments
Assignees

Comments

@aryamankha
Copy link
Owner

aryamankha commented Oct 11, 2022

Screen Shot 2022-10-11 at 6 21 04 PM

Implement sticky nav bar using Vivid! In the browser, command-click on any component to edit its code and hit Command-K to quickly preview styles. Command-Shift-K will let you add new empty components!

@aryamankha aryamankha changed the title Sticky Nav Bar Home - Sticky Nav Bar Oct 11, 2022
@Alphx-rgb
Copy link
Contributor

I'll work on this.

@aryamankha
Copy link
Owner Author

Great - assigning to you

@Alphx-rgb
Copy link
Contributor

I have almost created the component but stuck on some errors . Should I update the code for everybody to view?

@aryamankha
Copy link
Owner Author

aryamankha commented Oct 26, 2022

What are the errors you found? If you can get it to a place where there are no breaking changes, we can create a new issue to fix the errors you have. Right now, I'm getting an "object is not iterable erro" on AppSearchBar

@Rishabh2324
Copy link

Rishabh2324 commented Oct 27, 2022

Is this issue fixed... ? Facing same error

@Alphx-rgb
Copy link
Contributor

yeah, this is the error I am facing too... I am checking several resources but have not been able to figure out a solution. I guess we can create a new issue for this. In the meanwhile, I'll try myself also for correcting the same. And after this issue gets fixed, We can focus on building more components.

@Rishabh2324
Copy link

Rishabh2324 commented Oct 27, 2022

Take reference from this

  1. First update DataContext

export const initialState: IInitialState = { location: '', checkIn: null, checkOut: null, guests: { adults: 0, children: 0, infants: 0 }, };

export const DataContext = createContext<{ state: IInitialState; dispatch: React.Dispatch<any>; }>({ state: initialState, dispatch: () => null, });

interface IIProps { children: React.ReactNode; }

export const ContextProvider = ({ children }: any) => { const [state, dispatch] = useReducer(dataReducer, initialState); return ( <> <DataContext.Provider value={{ state, dispatch }}> {children} </DataContext.Provider> </> ); };

  1. While using your context in Date range Destruture like this
    const { state, dispatch } = useDataContext();
    const { location, checkIn, checkOut, guests } = state;

  2. Also add ContextProvider to parent component so that dispatch can work

  3. Avoid using any

  4. You might also need to add some null checks on you component while using state

This worked for me

@Alphx-rgb Alphx-rgb removed their assignment Oct 30, 2022
@Alphx-rgb
Copy link
Contributor

I am facing a few errors which I am unable to resolve. I'll work on it, if I get it, I'll make a PR.

@aryamankha aryamankha reopened this May 4, 2023
@Hamjaster
Copy link

I'd like to work on it. Please assign it to me.

@aryamankha
Copy link
Owner Author

Assigning it to you

@Hamjaster
Copy link

I've a question, what does Vivid in "Sticky Nav by using Vivid" means??

@Hamjaster
Copy link

I ran the code in my local environment, Theres just a simple navbar in it? what to do, ? I am quite confused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants