Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion frontend/src/screens/PodcastForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { ttsLanguageList } from '../helper/Utils';


const PodcastForm = ({navigation, route}: PodcastFormProp) => {
const MAX_TITLE_LENGTH = 100;
const [title, setTitle] = useState('');
const [description, setDescription] = useState('');
const [selectedGenres, setSelectedGenres] = useState<Category[]>([]);
Expand Down Expand Up @@ -264,8 +265,14 @@ const PodcastForm = ({navigation, route}: PodcastFormProp) => {
placeholderTextColor="#6b7280"
style={styles.inputControl}
value={title}
onChangeText={setTitle}
maxLength={MAX_TITLE_LENGTH}
onChangeText={text => {
if (text.length <= MAX_TITLE_LENGTH) {
setTitle(text);
}
}}
/>
<Text style={[styles.charCounter, title.length >= MAX_TITLE_LENGTH * 0.9 && styles.charCounterWarning, title.length >= MAX_TITLE_LENGTH && styles.charCounterError]}>{title.length} / {MAX_TITLE_LENGTH}</Text>
</View>

{/* Language Dropdown */}
Expand Down Expand Up @@ -519,6 +526,14 @@ const styles = StyleSheet.create({
fontSize: 13,
fontWeight: '500',
},
charCounterWarning: {
color: '#FFA500',
fontWeight: '600',
},
charCounterError: {
color: '#EF4444',
fontWeight: '700',
},
languageSelector: {
height: 50,
backgroundColor: '#fff',
Expand Down