Skip to content

Commit

Permalink
Merge pull request #941 from acro5piano/feature/repo-cleanup
Browse files Browse the repository at this point in the history
fix: remove useless files, format demo files
  • Loading branch information
acro5piano authored Oct 14, 2023
2 parents fc2cc0f + bb53b09 commit b50a3b4
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 42 deletions.
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ build
.jest
.storybook-build
/.idea

.DS_Store
4 changes: 0 additions & 4 deletions rndemo/.eslintrc.js

This file was deleted.

8 changes: 0 additions & 8 deletions rndemo/.prettierrc.js

This file was deleted.

40 changes: 14 additions & 26 deletions rndemo/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
View,
} from 'react-native'

import {Calendar, ICalendarEventBase, Mode} from './build'
import { Calendar, ICalendarEventBase, Mode } from './build'

const events = [
{
Expand Down Expand Up @@ -400,17 +400,15 @@ const events = [
]

export const App = () => {
const {height} = useWindowDimensions()
const { height } = useWindowDimensions()
const [mode, setMode] = React.useState<Mode>('week')
const [additionalEvents, setAdditionalEvents] = React.useState<
ICalendarEventBase[]
>([])
const [additionalEvents, setAdditionalEvents] = React.useState<ICalendarEventBase[]>([])

const addEvent = React.useCallback(
(start: Date) => {
const title = 'new Event'
const end = dayjs(start).add(59, 'minute').toDate()
setAdditionalEvents([...additionalEvents, {start, end, title}])
setAdditionalEvents([...additionalEvents, { start, end, title }])
},
[additionalEvents, setAdditionalEvents],
)
Expand All @@ -419,7 +417,7 @@ export const App = () => {
(start: Date) => {
const title = 'new Long Event'
const end = dayjs(start).add(1, 'hour').add(59, 'minute').toDate()
setAdditionalEvents([...additionalEvents, {start, end, title}])
setAdditionalEvents([...additionalEvents, { start, end, title }])
},
[additionalEvents, setAdditionalEvents],
)
Expand All @@ -432,34 +430,26 @@ export const App = () => {
<View style={styles.buttonRow}>
<TouchableOpacity
onPress={() => setMode('week')}
style={[
styles.buttonContainer,
mode === 'week' && styles.buttonContainerActive,
]}>
style={[styles.buttonContainer, mode === 'week' && styles.buttonContainerActive]}
>
<Text>week</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => setMode('day')}
style={[
styles.buttonContainer,
mode === 'day' && styles.buttonContainerActive,
]}>
style={[styles.buttonContainer, mode === 'day' && styles.buttonContainerActive]}
>
<Text>day</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => setMode('3days')}
style={[
styles.buttonContainer,
mode === '3days' && styles.buttonContainerActive,
]}>
style={[styles.buttonContainer, mode === '3days' && styles.buttonContainerActive]}
>
<Text>3days</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => setMode('month')}
style={[
styles.buttonContainer,
mode === 'month' && styles.buttonContainerActive,
]}>
style={[styles.buttonContainer, mode === 'month' && styles.buttonContainerActive]}
>
<Text>month</Text>
</TouchableOpacity>
</View>
Expand All @@ -472,7 +462,7 @@ export const App = () => {
sortedMonthView={false}
mode={mode}
moreLabel="+{moreCount}"
onPressMoreLabel={moreEvents => {
onPressMoreLabel={(moreEvents) => {
console.log(moreEvents)
}}
/>
Expand Down Expand Up @@ -501,5 +491,3 @@ const styles = StyleSheet.create({
fontSize: 16,
},
})

export default App
8 changes: 4 additions & 4 deletions rndemo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @format
*/

import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import { AppRegistry } from 'react-native'
import { App } from './App'
import { name as appName } from './app.json'

AppRegistry.registerComponent(appName, () => App);
AppRegistry.registerComponent(appName, () => App)
1 change: 1 addition & 0 deletions rndemo/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../prettier.config.js')

1 comment on commit b50a3b4

@vercel
Copy link

@vercel vercel bot commented on b50a3b4 Oct 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.