Skip to content

Commit

Permalink
feat: specify selection colour for inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexogamer committed Feb 7, 2025
1 parent 1bd90f8 commit cf59286
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/MessageBox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useContext, useState} from 'react';
import {Platform, Pressable, StyleSheet, TextInput, View} from 'react-native';
import {Platform, Pressable, StyleSheet, View} from 'react-native';
import {useTranslation} from 'react-i18next';
import {observer} from 'mobx-react-lite';

Expand All @@ -14,7 +14,7 @@ import {app, setFunction} from '@clerotri/Generic';
import {client} from '@clerotri/lib/client';
import {styles} from '@clerotri/Theme';
import {DocumentPicker} from '@clerotri/crossplat/DocumentPicker';
import {Avatar, Text, Username} from '@clerotri/components/common/atoms';
import {Avatar, Input, Text, Username} from '@clerotri/components/common/atoms';
import {USER_IDS} from '@clerotri/lib/consts';
import {storage} from '@clerotri/lib/storage';
import {commonValues, Theme, ThemeContext} from '@clerotri/lib/themes';
Expand Down Expand Up @@ -228,7 +228,7 @@ export const MessageBox = observer((props: MessageBoxProps) => {
/>
</Pressable>
) : null}
<TextInput
<Input
multiline
placeholderTextColor={currentTheme.foregroundSecondary}
style={{
Expand Down
3 changes: 3 additions & 0 deletions src/components/common/atoms/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export function Input(props: InputProps) {
props.isLoginInput ? localStyles.loginInput : localStyles.input,
props.style,
]}
cursorColor={currentTheme.accentColor}
selectionHandleColor={currentTheme.accentColor}
selectionColor={`${currentTheme.accentColor}60`}
{...props}
/>
);
Expand Down
3 changes: 3 additions & 0 deletions src/components/common/atoms/InputWithButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export function InputWithButton({
onChangeText={v => {
setValue(v);
}}
cursorColor={currentTheme.accentColor}
selectionHandleColor={currentTheme.accentColor}
selectionColor={`${currentTheme.accentColor}60`}
placeholder={placeholder}
style={[
localStyles.iwbInput,
Expand Down
9 changes: 5 additions & 4 deletions src/components/sheets/ReportSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useContext, useMemo, useRef, useState} from 'react';
import {ScrollView, StyleSheet, TextInput, View} from 'react-native';
import {ScrollView, StyleSheet, View} from 'react-native';
import {observer} from 'mobx-react-lite';

import type BottomSheetCore from '@gorhom/bottom-sheet';
Expand All @@ -11,6 +11,7 @@ import {client} from '@clerotri/lib/client';
import {
Avatar,
Button,
Input,
Text,
Username,
} from '@clerotri/components/common/atoms';
Expand Down Expand Up @@ -345,7 +346,7 @@ export const ReportSheet = observer(() => {
{reason.reason && !status.status && (
<>
<Text>You can add more context to your report here.</Text>
<TextInput
<Input
style={localStyles.input}
value={additionalContext}
onChangeText={(c: string) => {
Expand Down Expand Up @@ -387,7 +388,7 @@ export const ReportSheet = observer(() => {
{reason.reason && !status.status && (
<>
<Text>You can add more context to your report here.</Text>
<TextInput
<Input
style={localStyles.input}
value={additionalContext}
onChangeText={(c: string) => {
Expand Down Expand Up @@ -425,7 +426,7 @@ export const ReportSheet = observer(() => {
{reason.reason && !status.status && (
<>
<Text>You can add more context to your report here.</Text>
<TextInput
<Input
style={localStyles.input}
value={additionalContext}
onChangeText={(c: string) => {
Expand Down

0 comments on commit cf59286

Please sign in to comment.