Skip to content

Commit

Permalink
Fixed SortIndicator style type
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-podzigun committed Dec 12, 2024
1 parent 010aaf2 commit 7653de6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/sort/SortIndicator.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* @typedef {import("@farjs/ui/theme/Theme.mjs").ThemeStyle} ThemeStyle
* @typedef {import("./FileListSort.mjs").FileListSort} FileListSort
*/
import React from "react";
Expand All @@ -18,8 +19,9 @@ const h = React.createElement;
* @param {SortIndicatorProps} props
*/
const SortIndicator = (props) => {
/** @type {ThemeStyle} */
const style = FileListTheme.useTheme().fileList.header;
const stackProps = WithStack.useStack();
const theme = FileListTheme.useTheme().fileList;
const text = `${SortIndicator._getIndicator(props.sort)} `;

return h("text", {
Expand All @@ -30,7 +32,7 @@ const SortIndicator = (props) => {
autoFocus: false,
clickable: true,
mouse: true,
style: theme.header,
style,
onClick: () => {
process.stdin.emit("keypress", undefined, {
name: stackProps.isRight ? "r" : "l",
Expand Down
3 changes: 2 additions & 1 deletion types/sort/SortIndicator.d.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default SortIndicator;
export type ThemeStyle = import("@farjs/ui/theme/Theme.mjs").ThemeStyle;
export type FileListSort = import("./FileListSort.mjs").FileListSort;
export type SortIndicatorProps = {
readonly sort: FileListSort;
Expand All @@ -19,7 +20,7 @@ declare function SortIndicator(props: SortIndicatorProps): React.DOMElement<{
autoFocus: boolean;
clickable: boolean;
mouse: boolean;
style: import("../../../node_modules/@farjs/ui/types/theme/Theme.mjs").ThemeStyle;
style: import("@farjs/ui/theme/Theme.mjs").ThemeStyle;
onClick: () => void;
content: string;
}, Element>;
Expand Down

0 comments on commit 7653de6

Please sign in to comment.