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

Feature/accept arrow renders #24

Merged
merged 2 commits into from
Aug 3, 2020
Merged

Feature/accept arrow renders #24

merged 2 commits into from
Aug 3, 2020

Conversation

desko27
Copy link
Contributor

@desko27 desko27 commented Aug 3, 2020

What's been done

  • Isolate common arrow styles – mainly regarding arrow positioning.
  • Add ArrowLeft and ArrowRight props to pass custom components for slider arrows.

Screenshot

Screenshot 2020-08-03 at 12 16 27

Sample code

const buttonStyle = {
  background: 'transparent',
  border: 0,
  cursor: 'pointer',
  fontSize: 72,
  height: '30%',
  margin: 'auto 10px',
  padding: 15
}

function CustomArrow({emoji, ...props}) {
  return (
    <button {...props} style={buttonStyle}>
      <span role="img" aria-label="Arrow">
        {emoji}
      </span>
    </button>
  )
}

function CustomArrowLeft(props) {
  return <CustomArrow {...props} emoji="👈" />
}

function CustomArrowRight(props) {
  return <CustomArrow {...props} emoji="👉" />
}

<ReactSlidy ArrowLeft={CustomArrowLeft} ArrowRight={CustomArrowRight}>
  <img src="/1.jpg" />
  <img src="/2.jpg" />
  <img src="/3.jpg" />
  <img src="/4.jpg" />
</ReactSlidy>

@vercel
Copy link

vercel bot commented Aug 3, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/midudev/react-slidy/nrr2j5sl1
✅ Preview: https://react-slidy-git-fork-desko27-feature-accept-arrow-renders.midudev.vercel.app

Copy link
Owner

@midudev midudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cooooooooooool!

@midudev midudev merged commit e923bc1 into midudev:master Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants