mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-29 10:18:29 -04:00
- Added useDraftAutosave hook to handle automatic saving of post drafts. - Enhanced PostEditor component to include a preview tab that fetches and displays rendered markdown. - Updated Post model to manage draft state and associated published_at timestamp. - Introduced card_photo association to Post for representing a primary image. - Modified post form to support draft saving and publishing actions. - Updated navigation to include links to drafts. - Added tests for draft saving, preview functionality, and card photo validation. - Created migrations for new database fields related to drafts and card photos.
40 lines
2.2 KiB
React
40 lines
2.2 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 AlternateNames from './components/AlternateNames';
|
|
import AuthDialog from './components/AuthDialog';
|
|
import CardPhotoDialog from './components/CardPhotoDialog';
|
|
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 JobPicker from './components/JobPicker';
|
|
import LocationPicker from './components/LocationPicker';
|
|
import NurseryChip from './components/NurseryChip';
|
|
import NurseryPlanter from './components/NurseryPlanter';
|
|
import PhotoDialog from './components/PhotoDialog';
|
|
import PhotoPicker from './components/PhotoPicker';
|
|
import PlantPicker from './components/PlantPicker';
|
|
import RecordDialog from './components/RecordDialog';
|
|
import PlantingPicker from './components/PlantingPicker';
|
|
import PlantingActions from './components/PlantingActions';
|
|
import PlantingRating from './components/PlantingRating';
|
|
import PostEditor from './components/PostEditor';
|
|
import SeedLibrary from './components/SeedLibrary';
|
|
import ScientificNames from './components/ScientificNames';
|
|
import SeedStack from './components/SeedStack';
|
|
import {mountIslands, registerIslands} from './islands';
|
|
|
|
registerIslands({AlternateNames, AuthDialog, CardPhotoDialog, FeedMore, GardenCards, GardenLayout, GardenPicker, GrowingTable, HarvestChart, JobPicker, LocationPicker, NurseryChip, NurseryPlanter, PhotoDialog, PhotoPicker, PlantPicker, PlantingPicker, PlantingActions, PlantingRating, PostEditor, RecordDialog, ScientificNames, SeedLibrary, SeedStack});
|
|
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', () => mountIslands());
|
|
} else {
|
|
mountIslands();
|
|
}
|