Guide: Creating React Native โš›๏ธ App For Our Design Studio Application โ€“ Part 3

Let’s transform our DesignStudioMobileApp from the default template into a proper design studio interface. I’ll create the folder structure and implement all the features that is requested (https://github.com/MIRA-Designs/DesignStudioMobileApp/issues/4).

Step 1: Create Assets Folder Structure ๐Ÿ“

mkdir -p assets/images

๐Ÿ“ Image Location:

Place our design studio image at: assets/images/featured-design.png

๐Ÿ“ Detailed Code Explanation:

1. Import Statements (Lines 8-19)

import React from 'react';
import {
  SafeAreaView,
  ScrollView,
  StatusBar,
  StyleSheet,
  Text,
  View,
  TextInput,
  Image,
  TouchableOpacity,
  useColorScheme,
  Alert,
} from 'react-native';

What Each Import Does:

  • React – Core React library for component creation
  • SafeAreaView – Renders content within safe area (avoids notch/home indicator)
  • ScrollView – Container that allows scrolling when content exceeds screen
  • StatusBar – Controls device status bar appearance
  • StyleSheet – Creates optimized styling objects
  • Text – Displays text (like <span> in HTML)
  • View – Basic container (like <div> in HTML)
  • TextInput – Input field for user text entry
  • Image – Displays images
  • TouchableOpacity – Touchable button with opacity feedback
  • useColorScheme – Hook to detect dark/light mode
  • Alert – Shows native alert dialogs

2. Component State and Handlers (Lines 21-37)

function App() {
  // Hook to detect if device is in dark mode
  const isDarkMode = useColorScheme() === 'dark';

  // Handler function for search input
  const handleSearch = (text: string) => {
    console.log('Search query:', text);
    // You can add search logic here later
  };

  // Handler function for category button press
  const handleCategoryPress = (category: string) => {
    Alert.alert('Category Selected', `You selected: ${category}`);
    // You can add navigation logic here later
  };

Explanation:

  • isDarkMode – Boolean that’s true when device is in dark mode
  • handleSearch – Function called when user types in search bar
  • Parameter: text: string – what user typed
  • Action: Logs to console (you can add real search later)
  • handleCategoryPress – Function called when category button is pressed
  • Parameter: category: string – which category was pressed
  • Action: Shows an alert with selected category

3. Main UI Structure (Lines 39-42)

return (
  <SafeAreaView style={[styles.container, isDarkMode && styles.darkContainer]}>
    <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />

Explanation:

  • SafeAreaView – Main container that respects device safe areas
  • style={[styles.container, isDarkMode && styles.darkContainer]}
  • Array of styles: always applies container, adds darkContainer if dark mode
  • StatusBar – Controls status bar text color based on theme

4. Header Section (Lines 45-53)

{/* Header Section with App Title */}
<View style={styles.header}>
  <Text style={[styles.appTitle, isDarkMode && styles.darkText]}>
    ๐ŸŽจ Design Studio
  </Text>
  <Text style={[styles.subtitle, isDarkMode && styles.darkSubtitle]}>
    Discover Amazing Designs
  </Text>
</View>

Explanation:

  • Header container with shadow and background
  • App title with design studio emoji
  • Subtitle with descriptive text
  • Dynamic styling that adapts to dark/light mode

5. Search Bar (Lines 55-63)

{/* Search Bar Section */}
<View style={styles.searchContainer}>
  <TextInput
    style={[styles.searchInput, isDarkMode && styles.darkSearchInput]}
    placeholder="Search for designs..."
    placeholderTextColor={isDarkMode ? '#999' : '#666'}
    onChangeText={handleSearch}
  />
</View>

Explanation:

  • TextInput – The actual search input field
  • placeholder – Text shown when field is empty
  • placeholderTextColor – Color that adapts to theme
  • onChangeText={handleSearch} – Calls function when user types
  • Styling – Rounded corners, shadow, adaptive colors

6. Featured Image Section (Lines 65-85)

{/* Featured Image Section */}
<View style={styles.imageContainer}>
  <Text style={[styles.sectionTitle, isDarkMode && styles.darkText]}>
    Featured Design
  </Text>
  {/* Placeholder for your design studio image */}
  <View style={styles.imagePlaceholder}>
    <Text style={styles.imagePlaceholderText}>
      ๐Ÿ“ท Add your design studio image here
    </Text>
    <Text style={styles.imagePath}>
      Path: assets/images/featured-design.jpg
    </Text>
  </View>
</View>

Explanation:

  • Section title – “Featured Design”
  • Image placeholder – Dashed border box showing where to add image
  • Instructions – Shows exact path where to place your image
  • When you add real image: Replace placeholder with:
  <Image 
    source={require('./assets/images/featured-design.jpg')} 
    style={styles.featuredImage}
    resizeMode="cover"
  />

7. Content Area (Lines 87-95)

{/* Main Content Area */}
<View style={styles.contentContainer}>
  <Text style={[styles.sectionTitle, isDarkMode && styles.darkText]}>
    Browse by Category
  </Text>
  <Text style={[styles.description, isDarkMode && styles.darkSubtitle]}>
    Select a category to explore our design collections
  </Text>
</View>

Explanation:

  • Description section for the category buttons below
  • Instructional text to guide users

8. Bottom Footer with Category Icons (Lines 99-143)

{/* Bottom Footer with Category Icons */}
<View style={[styles.footer, isDarkMode && styles.darkFooter]}>

  <TouchableOpacity 
    style={styles.categoryButton}
    onPress={() => handleCategoryPress('Women')}
  >
    <Text style={styles.categoryIcon}>๐Ÿ‘ฉ</Text>
    <Text style={[styles.categoryText, isDarkMode && styles.darkText]}>Women</Text>
  </TouchableOpacity>

  {/* Similar structure for Men, Kids, Infants... */}
</View>

Explanation:

  • Footer container – Fixed bottom section with shadow
  • Four TouchableOpacity buttons – One for each category
  • Each button contains:
  • Icon – Emoji representing the category (๐Ÿ‘ฉ, ๐Ÿ‘จ, ๐Ÿ‘ถ, ๐Ÿผ)
  • Label – Text showing category name
  • onPress – Calls handleCategoryPress with category name
  • flex: 1 – Each button takes equal space (25% each)

9. Styling Breakdown

Container Styles:

container: {
  flex: 1,                    // Fill entire screen
  backgroundColor: '#f8f9fa', // Light gray background
},
darkContainer: {
  backgroundColor: '#1a1a1a', // Dark background for dark mode
},

Search Input Styles:

searchInput: {
  height: 50,                 // Fixed height
  backgroundColor: '#fff',    // White background
  borderRadius: 25,           // Fully rounded corners
  paddingHorizontal: 20,      // Left/right padding
  fontSize: 16,               // Text size
  borderWidth: 1,             // Thin border
  borderColor: '#e0e0e0',     // Light gray border
  shadowColor: '#000',        // Black shadow
  shadowOffset: { width: 0, height: 1 }, // Shadow position
  shadowOpacity: 0.1,         // Shadow transparency
  shadowRadius: 2,            // Shadow blur
  elevation: 2,               // Android shadow
},

Footer Styles:

footer: {
  flexDirection: 'row',       // Horizontal layout
  backgroundColor: '#fff',    // White background
  paddingVertical: 15,        // Top/bottom padding
  paddingHorizontal: 10,      // Left/right padding
  borderTopWidth: 1,          // Top border
  borderTopColor: '#e0e0e0',  // Border color
  shadowOffset: { width: 0, height: -2 }, // Upward shadow
  elevation: 5,               // Strong Android shadow
},

๐Ÿ“ฑ What You’ll See on Screen:

Top to Bottom Layout:

  1. ๐Ÿ“Š Status Bar – Adapts to light/dark mode
  2. ๐ŸŽจ Header – “Design Studio” title with subtitle
  3. ๐Ÿ” Search Bar – Rounded search input
  4. ๐Ÿ“ท Featured Image – Placeholder (will show your image)
  5. ๐Ÿ“ Content – “Browse by Category” section
  6. ๐Ÿ‘ฅ Footer – Four category buttons (Women, Men, Kids, Infants)

Interactive Elements:

  • Search bar – Type to trigger search function
  • Category buttons – Tap to show alert (later: navigation)
  • Scrollable content – Scroll up/down to see all content

Responsive Features:

  • Dark/Light mode – Automatically adapts to device settings
  • Safe areas – Respects device notches and home indicators
  • Shadows – Proper elevation on both iOS and Android

๐ŸŽฏ Next Steps:

  1. Add Your Image: Place your design studio image at assets/images/featured-design.jpg
  2. Replace Placeholder: Uncomment the Image component in the code
  3. Test Categories: Tap the footer buttons to see alerts
  4. Customize: Modify colors, sizes, or add more features

Our design studio app is now ready with a professional interface! ๐ŸŽจ๐Ÿ“ฑโœจ


Let’s see in Part 4..

Happy React Native Development ๐Ÿš€


Design Studio v0.9.5: A Visual Improvement in E-commerce Experience ๐ŸŽจ

Published: June 25, 2025

I am thrilled to announce the release of Design Studio v0.9.5, a major milestone that transforms our online shopping platform into a truly immersive visual experience. This release focuses heavily on user interface enhancements, performance optimizations, and creating a more engaging shopping journey for our customers.

๐Ÿš€ What’s New in v0.9.5

1. Stunning 10-Slide Hero Carousel

The centerpiece of this release is our brand-new interactive hero carousel featuring 10 beautifully curated slides with real product imagery. Each slide tells a story and creates an emotional connection with our visitors.

Dynamic Gradient Themes

Each slide features its own unique gradient theme:

<!-- Hero Slide Template -->
<div class="slide relative h-screen flex items-center justify-center overflow-hidden"
     data-theme="<%= slide[:theme] %>">
  <!-- Dynamic gradient backgrounds -->
  <div class="absolute inset-0 bg-gradient-to-br <%= slide[:gradient] %>"></div>

  <!-- Content with sophisticated typography -->
  <div class="relative z-10 text-center px-4">
    <h1 class="text-6xl font-bold text-white mb-6 leading-tight">
      <%= slide[:title] %>
    </h1>
    <p class="text-xl text-white/90 mb-8 max-w-2xl mx-auto">
      <%= slide[:description] %>
    </p>
  </div>
</div>

Smart Auto-Cycling with Manual Controls

// Intelligent carousel management
class HeroCarousel {
  constructor() {
    this.currentSlide = 0;
    this.autoInterval = 4000; // 4-second intervals
    this.isPlaying = true;
  }

  startAutoPlay() {
    this.autoPlayTimer = setInterval(() => {
      if (this.isPlaying) {
        this.nextSlide();
      }
    }, this.autoInterval);
  }

  pauseOnInteraction() {
    // Pause auto-play when user interacts
    this.isPlaying = false;
    setTimeout(() => this.isPlaying = true, 10000); // Resume after 10s
  }
}

2. Modular Component Architecture

We’ve completely redesigned our frontend architecture with separation of concerns in mind:

<!-- Main Hero Slider Component -->
<%= render 'home/hero_slider' %>

<!-- Individual Components -->
<%= render 'home/hero_slide', slide: slide_data %>
<%= render 'home/hero_slider_navigation' %>
<%= render 'home/hero_slider_script' %>
<%= render 'home/category_grid' %>
<%= render 'home/featured_products' %>

Component-Based Development Benefits:

  • Maintainability: Each component has a single responsibility
  • Reusability: Components can be used across different pages
  • Testing: Isolated components are easier to test
  • Performance: Selective rendering and caching opportunities

3. Enhanced Visual Design System

Glass Morphism Effects

We’ve introduced subtle glass morphism effects throughout the application:

/* Modern glass effect implementation */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Category cards with gradient overlays */
.category-card {
  @apply relative overflow-hidden rounded-xl;

  &::before {
    content: '';
    @apply absolute inset-0 bg-gradient-to-t from-black/60 to-transparent;
  }
}

Dynamic Color Management

Our new helper system automatically manages theme colors:

# app/helpers/application_helper.rb
def get_category_colors(gradient_class)
  case gradient_class
  when "from-pink-400 to-purple-500"
    "#f472b6, #8b5cf6"
  when "from-blue-400 to-indigo-500"  
    "#60a5fa, #6366f1"
  when "from-green-400 to-teal-500"
    "#4ade80, #14b8a6"
  else
    "#6366f1, #8b5cf6" # Elegant fallback
  end
end

def random_decorative_background
  themes = [:orange_pink, :blue_purple, :green_teal, :yellow_orange]
  decorative_background_config(themes.sample)
end

4. Mobile-First Responsive Design

Every component is built with mobile-first approach:

<!-- Responsive category grid -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
  <% categories.each do |category| %>
    <div class="group relative h-64 rounded-xl overflow-hidden cursor-pointer
                hover:scale-105 transform transition-all duration-300">
      <!-- Responsive image handling -->
      <div class="absolute inset-0">
        <%= image_tag category[:image], 
            class: "w-full h-full object-cover group-hover:scale-110 transition-transform duration-500",
            alt: category[:name] %>
      </div>
    </div>
  <% end %>
</div>

5. Public Product Browsing

We’ve opened up product browsing to all visitors:

# app/controllers/products_controller.rb
class ProductsController < ApplicationController
  # Allow public access to browsing
  allow_unauthenticated_access only: %i[index show]

  def index
    products = Product.all

    # Smart category filtering
    if params[:category].present?
      products = products.for_category(params[:category])
      @current_category = params[:category]
    end

    # Pagination for performance
    @pagy, @products = pagy(products)
  end
end

๐Ÿ”ง Technical Improvements

Test Coverage Excellence

I’ve achieved 73.91% test coverage (272/368 lines), ensuring code reliability:

# Enhanced authentication test helpers
module AuthenticationTestHelper
  def sign_in_as(user)
    # Generate unique IPs to avoid rate limiting conflicts
    unique_ip = "127.0.0.#{rand(1..254)}"
    @request.remote_addr = unique_ip

    session[:user_id] = user.id
    user
  end
end

Asset Pipeline Optimization

Rails 8 compatibility with modern asset handling:

# config/application.rb
class Application < Rails::Application
  # Modern browser support
  config.allow_browser versions: :modern

  # Asset pipeline optimization
  config.assets.css_compressor = nil # Tailwind handles this
  config.assets.js_compressor = :terser
end

Security Enhancements

# Role-based access control
class ApplicationController < ActionController::Base
  include Authentication

  private

  def require_admin
    unless current_user&.admin?
      redirect_to root_path, alert: "Access denied."
    end
  end
end

๐Ÿ“Š Performance Metrics

Before vs After v0.9.5:

MetricBeforeAfter v0.9.5Improvement
Test Coverage45%73.91%+64%
CI/CD Success23 failures0 failures+100%
Component Count3 monoliths8 modular components+167%
Mobile Score72/10089/100+24%

๐ŸŽจ Design Philosophy

This release embodies our commitment to:

  1. Visual Excellence: Every pixel serves a purpose
  2. User Experience: Intuitive navigation and interaction
  3. Performance: Fast loading without sacrificing beauty
  4. Accessibility: Inclusive design for all users
  5. Maintainability: Clean, modular code architecture

๐Ÿ”ฎ What’s Next?

Version 0.9.5 sets the foundation for exciting upcoming features:

  • Enhanced Search & Filtering
  • User Account Dashboard
  • Advanced Product Recommendations
  • Payment Integration
  • Order Tracking System

๐ŸŽ‰ Try It Today!

Experience the new Design Studio v0.9.5 and see the difference visual design makes in online shopping. Our hero carousel alone tells the story of modern fashion in 10 stunning slides.

Key Benefits for Users:

  • โœจ Immersive visual shopping experience
  • ๐Ÿ“ฑ Perfect on any device
  • โšก Lightning-fast performance
  • ๐Ÿ”’ Secure and reliable

For Developers:

  • ๐Ÿ—๏ธ Clean, maintainable architecture
  • ๐Ÿงช Comprehensive test suite
  • ๐Ÿ“š Well-documented components
  • ๐Ÿš€ Rails 8 compatibility

Design Studio v0.9.5 – Where technology meets artistry in e-commerce.

Download: GitHub Release
Documentation: GitHub Wiki
Live Demo: Design Studio – coming soon!


Enjoy Rails 8 with Hotwire! ๐Ÿš€