mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 21:01:23 +02:00
Move inactive projects out of active workspace: - bauntown (community website) - maerchenzauber (AI story generation) - memoro (voice memo app) - news (news aggregation) - nutriphi (nutrition tracking) - reader (reading app) - uload (URL shortener) - wisekeep (AI wisdom extraction) Update CLAUDE.md documentation: - Add presi to active projects - Document archived projects section - Update workspace configuration Archived apps can be re-activated by moving back to apps/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
77 lines
1.4 KiB
TypeScript
77 lines
1.4 KiB
TypeScript
/**
|
|
* NotificationBadge Component
|
|
*
|
|
* A small red badge with a number indicating notification count.
|
|
* Typically used to show unread items, pending actions, etc.
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { View, StyleSheet, ViewStyle } from 'react-native';
|
|
import Text from './Text';
|
|
|
|
interface NotificationBadgeProps {
|
|
count: number;
|
|
size?: 'small' | 'medium';
|
|
style?: ViewStyle;
|
|
}
|
|
|
|
export const NotificationBadge: React.FC<NotificationBadgeProps> = ({
|
|
count,
|
|
size = 'small',
|
|
style,
|
|
}) => {
|
|
// Don't render if count is 0
|
|
if (count <= 0) {
|
|
return null;
|
|
}
|
|
|
|
// Determine badge size
|
|
const badgeSize = size === 'small' ? 18 : 22;
|
|
const fontSize = size === 'small' ? 11 : 13;
|
|
|
|
// Format count (max 99+)
|
|
const displayCount = count > 99 ? '99+' : count.toString();
|
|
|
|
return (
|
|
<View
|
|
style={[
|
|
styles.badge,
|
|
{
|
|
width: badgeSize,
|
|
height: badgeSize,
|
|
borderRadius: badgeSize / 2,
|
|
minWidth: badgeSize,
|
|
},
|
|
style,
|
|
]}
|
|
>
|
|
<Text
|
|
style={[
|
|
styles.badgeText,
|
|
{
|
|
fontSize,
|
|
lineHeight: fontSize + 2,
|
|
},
|
|
]}
|
|
>
|
|
{displayCount}
|
|
</Text>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
badge: {
|
|
backgroundColor: '#EF4444', // Red-500
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
paddingHorizontal: 2,
|
|
},
|
|
badgeText: {
|
|
color: '#FFFFFF',
|
|
fontWeight: '700',
|
|
textAlign: 'center',
|
|
},
|
|
});
|
|
|
|
export default NotificationBadge;
|