Refactor logo usage in About and NewAppUpdate components to use FarmControlAppIcon component for consistency and maintainability.
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good

This commit is contained in:
Tom Butcher 2026-06-21 15:39:21 +01:00
parent 78dc567a8f
commit b6c72bb902
3 changed files with 26 additions and 8 deletions

View File

@ -20,6 +20,7 @@ import { AuthContext } from '../context/AuthContext'
import { ElectronContext } from '../context/ElectronContext' import { ElectronContext } from '../context/ElectronContext'
import { AppUpdateContext } from '../context/AppUpdateContext' import { AppUpdateContext } from '../context/AppUpdateContext'
import { useMediaQuery } from 'react-responsive' import { useMediaQuery } from 'react-responsive'
import FarmControlAppIcon from '../../Logos/FarmControlAppIcon'
const { Title, Text, Link } = Typography const { Title, Text, Link } = Typography
const About = () => { const About = () => {
@ -125,9 +126,7 @@ const About = () => {
collapseKey='purchaseOrderStats' collapseKey='purchaseOrderStats'
> >
<Flex gap='large'> <Flex gap='large'>
<img <FarmControlAppIcon
src={'/logo512.png'}
alt='Farm Control Logo'
style={{ width: '200px', height: '200px' }} style={{ width: '200px', height: '200px' }}
/> />
<Flex vertical gap='small' justify='center'> <Flex vertical gap='small' justify='center'>

View File

@ -1,6 +1,7 @@
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { Button, Flex, Typography, Card } from 'antd' import { Button, Flex, Typography, Card } from 'antd'
import TimeDisplay from '../../common/TimeDisplay' import TimeDisplay from '../../common/TimeDisplay'
import FarmControlAppIcon from '../../../Logos/FarmControlAppIcon'
const { Text, Title } = Typography const { Text, Title } = Typography
@ -15,11 +16,7 @@ const NewAppUpdate = ({ update, onCancel, onUpdate }) => {
</Text> </Text>
<Card styles={{ body: { padding: 12 } }}> <Card styles={{ body: { padding: 12 } }}>
<Flex gap={12}> <Flex gap={12}>
<img <FarmControlAppIcon style={{ width: '70px', height: '70px' }} />
src={'/logo512.png'}
alt='Farm Control Logo'
style={{ width: '70px', height: '70px' }}
/>
<Flex vertical gap={2} justify='center'> <Flex vertical gap={2} justify='center'>
<Title level={3} style={{ margin: 0 }}> <Title level={3} style={{ margin: 0 }}>
{'Farm Control UI'} {'Farm Control UI'}

View File

@ -0,0 +1,22 @@
import PropTypes from 'prop-types'
const FarmControlAppIcon = ({ alt = 'Farm Control Logo', style, ...props }) => {
const useRelativePath =
typeof window !== 'undefined' && window.location.href.includes('index.html')
return (
<img
src={`${useRelativePath ? '.' : ''}/logo512.png`}
alt={alt}
style={style}
{...props}
/>
)
}
FarmControlAppIcon.propTypes = {
alt: PropTypes.string,
style: PropTypes.object
}
export default FarmControlAppIcon