macross-weather
v0.5.8
Published
A React library for displaying weather information components.
Readme
@macross/weather
A React library for displaying weather information components. This package provides weather forecasts for different regions, allowing users to select their area and view current weather conditions, including temperature, precipitation, and weather icons.
Installation
npm install @macross/weatherUsage
import { Weather } from '@macross/weather';
import '@macross/weather/style.css';
function App() {
return (
<div>
<Weather />
</div>
);
}Project Structure
The project is organized as follows:
macross-weather
├── src
│ ├── components
│ │ ├── Weather # Main Weather component
│ │ │ ├── Weather.js # Weather component logic
│ │ │ ├── Weather.module.scss # Styles for Weather component
│ │ │ └── index.js # Exports Weather component
│ │ ├── Areas # Areas component for region selection
│ │ │ ├── Areas.js # Areas component logic
│ │ │ └── index.js # Exports Areas component
│ │ └── WeatherData # WeatherData component for displaying weather info
│ │ ├── WeatherData.js # WeatherData component logic
│ │ ├── WeatherData.module.scss # Styles for WeatherData component
│ │ └── index.js # Exports WeatherData component
│ ├── constants # Constants used throughout the module
│ │ └── WeatherConstants.js # Weather-related constants
│ ├── services # Service for HTTP requests
│ │ └── HttpService.js # HTTP service for fetching weather data
│ ├── includes # Utility functions
│ │ └── utils.js # Utility functions for date conversion
│ ├── App.js # Main application entry point
│ └── index.js # React application entry point
├── package.json # npm configuration file
├── README.md # Project documentation
└── .gitignore # Git ignore fileInstallation
Clone the repository:
git clone <repository-url>Navigate to the project directory:
cd macross-weatherInstall the dependencies:
pnpm install
Usage
To start the development server, run:
pnpm run devThe application will be available at http://localhost:3001.
Features
- Displays current weather conditions for selected areas.
- Allows users to select different regions and view their weather forecasts.
- Responsive design for mobile and desktop views.
- Fetches weather data from an external API.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Install from Bitbucket
You can install this library directly from Bitbucket using npm or yarn:
npm install git+ssh://[email protected]:<your-team>/<your-repo>.gitOr with yarn:
yarn add git+ssh://[email protected]:<your-team>/<your-repo>.gitUsage in Your Project
Import the components and utilities you need:
import { Weather } from 'weather';
// or if you use the UMD build directly:
// <script src="dist/macross-weather.js"></script>
// window.WeatherMicrofrontend.Weather
// Example usage
<Weather />Refer to the documentation below for details on each export.
