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

fix: Makes Loader go from 0 to 100 instead of 0 to 1 #280

Merged
merged 3 commits into from
Feb 3, 2021
Merged
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
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"sandboxes": ["4nc1u", "bfplr"],
"sandboxes": ["4nc1u", "bfplr", "1wh6f"],
"packages": ["dist"]
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Drei currently exports OrbitControls [![](https://img.shields.io/badge/-codesand
<Sphere>
<meshBasicMaterial attach="material" color="hotpink" />
</Sphere>
```
```

#### RoundedBox

Expand Down Expand Up @@ -513,7 +513,7 @@ The rendertarget is automatically disposed when unmounted.

#### Html

[![](https://img.shields.io/badge/-codesandbox-blue)](https://codesandbox.io/s/r3f-suspense-zu2wo) ![](https://img.shields.io/badge/-Dom&nbsp;only-red)
[![](https://img.shields.io/badge/-codesandbox-blue)](https://codesandbox.io/s/r3f-suspense-zu2wo) ![](https://img.shields.io/badge/-Dom only-red)

Allows you to tie HTML content to any object of your scene. It will be projected to the objects whereabouts automatically.

Expand Down Expand Up @@ -825,9 +825,9 @@ const errors = useProgress((state) => state.errors)

#### Loader

![](https://img.shields.io/badge/-Dom&nbsp;only-red)
![](https://img.shields.io/badge/-Dom only-red)

A quick and easy loading overlay component that you can drop on top of your canvas. It will show an animated loadingbar and a percentage.
A quick and easy loading overlay component that you can drop on top of your canvas. It's intended to "hide" the whole app, so if you have multiple suspense wrappers in your application, you should use multiple loaders. It will show an animated loadingbar and a percentage.

```jsx
<Canvas>
Expand Down
2 changes: 1 addition & 1 deletion src/web/Loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function Loader({
innerStyles,
barStyles,
dataStyles,
dataInterpolation = (p: number) => `Loading ${p.toFixed(2)}%`,
dataInterpolation = (p: number) => `Loading ${(p * 100).toFixed(2)}%`,
initialState = (active: boolean) => active,
}: Partial<LoaderOptions>) {
const { active, progress } = useProgress()
Expand Down