mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-29 18:28:28 -04:00
The garden dialog now adds a garden as well as edits one (new.json and create.json on GardensController), and a GardenPicker button opens it from the home page. A plant_picker helper replaces the home page's separate plant links and the plant_button partial. The plant dialog asks when it was planted (Today, Yesterday, Enter date), using a WhenPicker shared with the harvest dialog. Members with no garden still get the full-page plant link. Part of #4933 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
31 lines
1.6 KiB
React
31 lines
1.6 KiB
React
// Entry point for the React "islands": small React components mounted into
|
|
// server-rendered pages. Rails renders an empty element with
|
|
// data-react-component="Name" and data-props='{...}' (see the react_component
|
|
// helper); this finds each one and mounts the matching component.
|
|
//
|
|
// To add a component: create it in ./components and register it below.
|
|
import FeedMore from './components/FeedMore';
|
|
import GardenCards from './components/GardenCards';
|
|
import GardenLayout from './components/GardenLayout';
|
|
import GardenPicker from './components/GardenPicker';
|
|
import GrowingTable from './components/GrowingTable';
|
|
import HarvestChart from './components/HarvestChart';
|
|
import LocationPicker from './components/LocationPicker';
|
|
import PhotoDialog from './components/PhotoDialog';
|
|
import PhotoPicker from './components/PhotoPicker';
|
|
import PlantPicker from './components/PlantPicker';
|
|
import PlantingPicker from './components/PlantingPicker';
|
|
import PlantingActions from './components/PlantingActions';
|
|
import PlantingRating from './components/PlantingRating';
|
|
import SeedLibrary from './components/SeedLibrary';
|
|
import SeedStack from './components/SeedStack';
|
|
import {mountIslands, registerIslands} from './islands';
|
|
|
|
registerIslands({FeedMore, GardenCards, GardenLayout, GardenPicker, GrowingTable, HarvestChart, LocationPicker, PhotoDialog, PhotoPicker, PlantPicker, PlantingPicker, PlantingActions, PlantingRating, SeedLibrary, SeedStack});
|
|
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', () => mountIslands());
|
|
} else {
|
|
mountIslands();
|
|
}
|