30 lines
No EOL
1.6 KiB
TypeScript
30 lines
No EOL
1.6 KiB
TypeScript
import React from 'react';
|
|
import Svg, { Path } from 'react-native-svg';
|
|
|
|
interface MeIconProps {
|
|
focused: boolean;
|
|
size: number;
|
|
color: string;
|
|
}
|
|
|
|
const MeIcon: React.FC<MeIconProps> = ({ focused, size, color }) => {
|
|
if (focused) {
|
|
// Selected state SVG (filled user)
|
|
return (
|
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
<Path d="M12 2C9.37665 2 7.25 4.12665 7.25 6.75C7.25 9.37335 9.37665 11.5 12 11.5C14.6234 11.5 16.75 9.37335 16.75 6.75C16.75 4.12665 14.6234 2 12 2Z" fill={color}/>
|
|
<Path d="M9 13C6.37665 13 4.25 15.1266 4.25 17.75C4.25 20.3734 6.37665 22.5 9 22.5H15C17.6234 22.5 19.75 20.3734 19.75 17.75C19.75 15.1266 17.6234 13 15 13H9Z" fill={color}/>
|
|
</Svg>
|
|
);
|
|
} else {
|
|
// Unselected state SVG (outlined user)
|
|
return (
|
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
<Path fillRule="evenodd" clipRule="evenodd" d="M12 1.25C9.37665 1.25 7.25 3.37665 7.25 6C7.25 8.62335 9.37665 10.75 12 10.75C14.6234 10.75 16.75 8.62335 16.75 6C16.75 3.37665 14.6234 1.25 12 1.25ZM8.75 6C8.75 4.20507 10.2051 2.75 12 2.75C13.7949 2.75 15.25 4.20507 15.25 6C15.25 7.79493 13.7949 9.25 12 9.25C10.2051 9.25 8.75 7.79493 8.75 6Z" fill={color}/>
|
|
<Path fillRule="evenodd" clipRule="evenodd" d="M9 12.25C6.37665 12.25 4.25 14.3766 4.25 17C4.25 19.6234 6.37665 21.75 9 21.75H15C17.6234 21.75 19.75 19.6234 19.75 17C19.75 14.3766 17.6234 12.25 15 12.25H9ZM5.75 17C5.75 15.2051 7.20507 13.75 9 13.75H15C16.7949 13.75 18.25 15.2051 18.25 17C18.25 18.7949 16.7949 20.25 15 20.25H9C7.20507 20.25 5.75 18.7949 5.75 17Z" fill={color}/>
|
|
</Svg>
|
|
);
|
|
}
|
|
};
|
|
|
|
export default MeIcon; |