mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
Add commitment progress bar
Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
committed by
Alexis Sellier
parent
3df68ef0b1
commit
186efa00b0
@@ -0,0 +1,34 @@
|
||||
<script lang="ts">
|
||||
import type { Config } from "@app/config";
|
||||
|
||||
export let config: Config;
|
||||
export let startBlock: number;
|
||||
export let duration: number;
|
||||
|
||||
let currentBlock: number = startBlock;
|
||||
|
||||
config.provider.on("block", (latestBlock: number) => {
|
||||
if (startBlock + duration > currentBlock) currentBlock = latestBlock;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.parent {
|
||||
text-align: center;
|
||||
height: 20px;
|
||||
width: 290px;
|
||||
border-radius: 5px;
|
||||
background-color: var(--color-secondary-background);
|
||||
}
|
||||
.loader {
|
||||
color: #fff;
|
||||
height: 20px;
|
||||
width: 0px;
|
||||
border-radius: 5px;
|
||||
background-color: var(--color-secondary);
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="parent">
|
||||
<div class="loader" style="width: {(currentBlock - startBlock) * 10}%" />
|
||||
</div>
|
||||
Reference in New Issue
Block a user