Skip to content

Commit

Permalink
feat(ui): make history entries selectable
Browse files Browse the repository at this point in the history
Closes #12
  • Loading branch information
paradoxuum committed Feb 10, 2024
1 parent 60ce636 commit 9942369
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/client/interface/components/interface/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import { BindingOrValue } from "@rbxts/pretty-react-hooks";
import { DEFAULT_FONT } from "../../constants/fonts";
import { TextProps } from "./Text";

const GRADIENT = new NumberSequence([
new NumberSequenceKeypoint(0, 0),
new NumberSequenceKeypoint(0.75, 0),
new NumberSequenceKeypoint(1, 1),
]);

interface TextFieldProps extends TextProps<TextBox> {
text?: BindingOrValue<string>;
placeholderText?: BindingOrValue<string>;
Expand Down Expand Up @@ -40,6 +34,7 @@ export const TextField = forwardRef(
TextXAlignment={props.textXAlignment}
TextYAlignment={props.textYAlignment}
TextScaled={props.textScaled}
RichText={props.richText}
AutomaticSize={props.textAutoResize}
Size={props.size}
Position={props.position}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Frame } from "../../interface/Frame";
import { Group } from "../../interface/Group";
import { Outline } from "../../interface/Outline";
import { Text } from "../../interface/Text";
import { TextField } from "../../interface/TextField";

interface HistoryLineProps {
data: HistoryEntry;
Expand Down Expand Up @@ -53,17 +54,19 @@ export function HistoryLine({ data, size, position, order }: HistoryLineProps) {
/>
</Frame>

<Text
<TextField
key="entry-text"
anchorPoint={new Vector2(1, 0)}
size={new UDim2(1, -rem(6.5), 1, 0)}
position={UDim2.fromScale(1, 0)}
text={data.text}
textSize={rem(1.5)}
textColor={data.success ? palette.text : palette.red}
textEditable={false}
textXAlignment="Left"
clearTextOnFocus={false}
font={fonts.inter.medium}
richText={true}
richText
/>
</Group>
);
Expand Down

0 comments on commit 9942369

Please sign in to comment.