Skip to content

Commit

Permalink
Update types and add docs for releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnPhamous committed Jan 4, 2025
1 parent ccb97c3 commit 4158c7d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ sf --version # 0.1.0
- `deno run devv` to test against local API
- `deno run prod` to test against production API
- The `deno run <env>` is an alias to the user facing `sf` command. So if you wanted to run `sf login` locally against the local API, run `deno run devv login`

## New Release

This is ran locally

- `deno run release <major|minor|patch>`
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
"peerDependencies": {
"typescript": "^5.6.2"
},
"version": "0.1.10"
}
"version": "0.1.11"
}
23 changes: 21 additions & 2 deletions src/lib/orders/OrderDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,23 @@ export function OrderDisplay(props: {
);
}

const reducer = (state, action) => {
interface ScrollState {
innerHeight: number;
height: number;
scrollTop: number;
}

type ScrollAction =
| { type: "SET_INNER_HEIGHT"; innerHeight: number }
| { type: "SCROLL_DOWN" }
| { type: "SCROLL_DOWN_BULK" }
| { type: "SCROLL_UP" }
| { type: "SCROLL_UP_BULK" }
| { type: "SCROLL_TO_TOP" }
| { type: "SCROLL_TO_BOTTOM" }
| { type: "SWITCHED_TAB" };

const reducer = (state: ScrollState, action: ScrollAction): ScrollState => {
switch (action.type) {
case "SET_INNER_HEIGHT":
return {
Expand Down Expand Up @@ -297,9 +313,12 @@ export function ScrollArea({
sellOrdersCount: number;
buyOrdersCount: number;
}) {
const [state, dispatch] = React.useReducer(reducer, {
const [state, dispatch] = React.useReducer<
React.Reducer<ScrollState, ScrollAction>
>(reducer, {
height,
scrollTop: 0,
innerHeight: 0,
});

const innerRef = React.useRef(null);
Expand Down

0 comments on commit 4158c7d

Please sign in to comment.