How to implement the isotope-layout in next.js project? - javascript

I want to implement the isotope-layout in next.js project.
For that, I tried to do that with the following blog.
https://stackoverflow.com/questions/25135261/react-js-and-isotope-js
Also, here is the codesandbox link.
https://codesandbox.io/s/react-isotope-typescript-i9x5v?file=/src/App.tsx:1152-1504
That works for React project.
But when I try in next.js project, I can see the following error.
If anyone has a solution, please help me!
Thanks.

I too faced the same problem with Isotope and NextJS. At last I used https://github.com/ZitRos/react-xmasonry and got it worked. Store items in the state, Add your own filter buttons to update the state, and loop through the items inside XMasonary.
This demo page will give an idea
https://github.com/ZitRos/react-xmasonry/blob/master/docs/jsx/ContentChangesDemo.jsx

Related

How can I do custom text selection in react native?

I just want to do a simple task here. Select some text and then do some manipulation on the selected text.
I have searched for over a day on custom selection in react native but couldn't find any solution for it. Any help would be appreciated.
I tried a package react-native-selectable-text. But GitHub repo for this package is archived and there is a issue in this package. And when I visited the issue list of the repo this issue wasn't entertained and there was not a single comment on that particular issue.

How to create pills input fields in react native?

I'm looking for a way to make "dynamic pills" like the ones below, but in React Native and Redux.
https://codepen.io/silkine/pen/pPxJOX
<div id="container"></div>
<div class="tim">this codepen is dedicated to
#twholman
</div>
1) Anyone know what they are called so it's easier to google tutorials?
2) I'm trying to convert the css with gulp and copy paste the JS into RN, but changing react syntax into RN. Getting a lot of errors. Is this a good path? Or do you know a simpler one? Maybe a tutorial somewhere?
Thanks!
It's called Badge.
You can use UI Kit like react-native-elements or you can check out code of this element in github repo. Use 'children' prop to pass TextInput.

drop down code for store locator on magento

Please can anyone help with the code for a drop down for store locator in magento,this is a look alike of what i want to achieve:
http://www.watchrepublic.co.za/store-locator.html
Thank you.
I have no experience with Magento, but after a bit of googling, I came across a drop down menu extension.
OK, I'd make a custom module for this. Take a look at this to serve frontend files like the menu you'd like to make.
http://alanstorm.com/magento-2-frontend-files-serving/
Create all the routes and then call the Menu within your default.xml
<referenceContainer name="header.panel">
<block class="Magento\Framework\View\Element\Html\Links" name="responsive.new.menu" template="Yourtheme_Menu::responsiveMenu.phtml />
</referenceContainer>

Setting up infiniteScroll in angularjs with default code

here is the link to the full code.
http://binarymuse.github.io/ngInfiniteScroll/demo_async.html#
I copied the code from infiniteScoll's website and it is still not working. The error I am receiving is "$window is not a function". Could someone direct me to a tutorial or maybe something better? Also it fails to instantiate when I add 'infiniteScroll' to angular.module('starter', ['infiniteScroll'])
What am I doing wrong? I tried using my own customized code but that doesn't work. I copy and paste the code from the sample they have there and even that doesn't work.
You can try using this script:
http://binarymuse.github.io/ngInfiniteScroll/
Infinite scroll uses Jquery as dependency. You will need to include Jquery and it will work.

Ionic 3 coverflow implemention

Hi everybody i am working on ionic 3 application. I need to have a cover-flow like this: react coverflow
I have searched so many places but couldn't find one for ionic 2 or above. i also tried a "jquery coverflow" and "swiper" but i dont know how to call a function from the javascript file.
can any one help me to
1. import and use Swiper in ionic 2 or above.
2. import and use javascript files without using npm.
Thanks in advance.
You are able to use the ion-slides from Ionic themselves. And because it is build on top of Swiper, you are able to pass in every option found in their docs. You should take a look at it. More info about the use of ion-slides take a look at Slides documentation.
Joeri is correct, you can use ion-slides. Check inline documentation here in this code: https://github.com/ionic-team/ionic/blob/master/src/components/slides/slides.ts
Specifically lines: 137 and onwards.
What you need to implement (coverflow) can be configured through advanced options.
Check lines 221-225 - the setting you need is in there.
Refer to Ionic documentation on how to enable advanced features:
https://ionicframework.com/docs/api/components/slides/Slides/#advanced
Small hint:
Now once you will do the code in your component to be able to use those listed methods be aware that if your slides component is wrapped into directive such as ngIfetc - you may have issue with ChildView of slides being "undefined". You need to make sure the component is there to initialize the code. This is something that caused trouble in my case;/

Categories

Resources