Skip to content

Commit

Permalink
Merge pull request #5 from xm0onh/fees
Browse files Browse the repository at this point in the history
Fees and Rewards - Merge
  • Loading branch information
Xm0onh authored Apr 16, 2024
2 parents d4824bb + 37ac4af commit 24daca9
Show file tree
Hide file tree
Showing 7 changed files with 429 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ yarn-debug.log*
yarn-error.log*

*.env

venv
409 changes: 409 additions & 0 deletions docs/Fees_and_Rewards.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/glossary.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Glossary
sidebar_position: 5
description: Collection of terms and definitions used within the subspace network.
sidebar_position: 6
description: Collection of terms and definitions used within the network.
keywords:
- glossary
- terminology
Expand Down
27 changes: 14 additions & 13 deletions src/components/Collapsible/Collapsible.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@
outline-offset: 2px;
}

.collapsible-content {
max-height: 0;
.collapsible .collapsible-content {
overflow: hidden;
transition: max-height 0.5s ease-in-out;
background: var(--ifm-background-color);
border-top: none;
padding: 0 1rem;
}

.collapsible-content.open {
max-height: 500px;
padding-top: 0.5rem;
padding-bottom: 1rem;
}
background: var(--ifm-background-color);
transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
padding: 0;
margin: 0;
display: none;
}

.collapsible .collapsible-content.open {
display: block;
padding: 0.5rem 1rem;
max-height: auto;
}


18 changes: 3 additions & 15 deletions src/components/Collapsible/Collapsible.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, useState, useEffect } from 'react';
import React, { useState } from 'react';
import './Collapsible.css';

export interface CollapsibleProps {
Expand All @@ -8,28 +8,16 @@ export interface CollapsibleProps {

const Collapsible: React.FC<CollapsibleProps> = ({ title, children }) => {
const [isOpen, setIsOpen] = useState(false);
const contentRef = useRef<HTMLDivElement>(null);
const [maxHeight, setMaxHeight] = useState<string>('0px');

useEffect(() => {
if (isOpen && contentRef.current) {
setMaxHeight(`${contentRef.current.scrollHeight}px`);
} else {
setMaxHeight('0px');
}
}, [isOpen]);

return (
<div className="collapsible">
<button className="collapsible-toggle" onClick={() => setIsOpen(!isOpen)}>
{isOpen ? '▼' : '►'} {title}
</button>
<div
className="collapsible-content"
ref={contentRef}
style={{ maxHeight: maxHeight }}
className={`collapsible-content ${isOpen ? 'open' : ''}`}
>
{children}
{isOpen && children}
</div>
</div>
);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 24daca9

Please sign in to comment.