Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Loading circle/Spinner customization #63

Closed
ray-su opened this issue Sep 2, 2017 · 9 comments
Closed

Loading circle/Spinner customization #63

ray-su opened this issue Sep 2, 2017 · 9 comments

Comments

@ray-su
Copy link

ray-su commented Sep 2, 2017

Hello! Thank you for this great package.
Is it possible to add Loading circle/Spinner customization to it?

@dmoli
Copy link

dmoli commented Jan 19, 2018

@ray-su did you can add a custom image?

@ray-su
Copy link
Author

ray-su commented Jan 19, 2018

@kaizenberg I didn't. If I remember correctly, the loading spinner is not a looping gif. it's made using CSS transform.

@3nvi
Copy link

3nvi commented Jan 27, 2018

Any progress on that? From my perspective i'd love to be able to provide a react element as a custom loader. Like so:

<Lightbox
  {...otherProps}
  spinner={<MyCustomLoader />}
/>

@fritz-c
Copy link
Member

fritz-c commented Jan 28, 2018

This is a good candidate for a pull request.

@mik639
Copy link

mik639 commented Jun 27, 2018

Hi guys, I have pr for this :) #125

@borisrorsvort
Copy link

@wuweiweiwu @fritz-c Any update on this? Can you tell us what to do/expect?

@SeinopSys
Copy link

Seems like this was implemented in #385 but the TypeScript type definitions weren't updated, so attempting to use the loader property results in a type error.

@ghost
Copy link

ghost commented Sep 17, 2021

Hello @SeinopSys,

Can you explain a bit more the issue? When I try to implement a custom loader component, by using the loader={}, I get no error at all. <Lightbox... loader={<Test/>}/>

With my test component being:

const Test = () => { return ( <div style={{...}}>Loading...</div> ); }

Result I get:
Screen Shot 2021-09-17 at 9 45 48 AM

@SeinopSys
Copy link

SeinopSys commented Sep 17, 2021

That's not TypeScript though. I created a CodeSandbox link which shows the issue: https://codesandbox.io/s/react-image-lightbox-typescript-error-cn3hw?file=/src/LightboxExample.tsx

The loader prop is not recognized by TypeScript due to that property missing from the interface inside index.d.ts in the root of the project.

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

No branches or pull requests

7 participants