<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: RedbeardJunior</title>
    <description>The latest articles on DEV Community by RedbeardJunior (@redbeardjunior).</description>
    <link>https://dev.to/redbeardjunior</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F537771%2Fa00877a1-4445-44f2-a448-ce10a2256578.png</url>
      <title>DEV Community: RedbeardJunior</title>
      <link>https://dev.to/redbeardjunior</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/redbeardjunior"/>
    <language>en</language>
    <item>
      <title>Create a simple search bar with checkboxes</title>
      <dc:creator>RedbeardJunior</dc:creator>
      <pubDate>Wed, 10 Apr 2024 13:29:28 +0000</pubDate>
      <link>https://dev.to/redbeardjunior/create-a-simple-search-bar-with-checkboxes-5ea3</link>
      <guid>https://dev.to/redbeardjunior/create-a-simple-search-bar-with-checkboxes-5ea3</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fscw0zpb780hjpmyayldf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fscw0zpb780hjpmyayldf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this post, we'll create a job search application using React and Next.js. The application will consist of two main pages: a front page with a welcome message and a link to the search page, and a search page where users can filter job listings based on various criteria.&lt;/p&gt;

&lt;p&gt;Prerequisites&lt;br&gt;
Basic knowledge of React and Next.js&lt;br&gt;
Node.js and npm installed on your machine&lt;br&gt;
Step 1: Setting Up the Project&lt;br&gt;
First, let's set up a new Next.js project. Open your terminal and run the following commands:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

npx create-next-app job-search-app
cd job-search-app


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Step 2: Creating the Front Page Component&lt;br&gt;
Inside the pages directory, create a new file named page.tsx with the following content:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import React from 'react';
import Link from 'next/link';

export default function Home() {
  return (
    &amp;lt;main className="flex min-h-screen flex-col items-center justify-between p-24"&amp;gt;
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Welcome to My Search App&amp;lt;/h1&amp;gt;
      &amp;lt;Link href="/search"&amp;gt;
        Go to Search Page
      &amp;lt;/Link&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/main&amp;gt;
  )
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Step 3: Creating the Search Page Component&lt;br&gt;
In the pages directory, create a folder (webpages) in side that folder add a folder search in that folder you create a new file named page.tsx with the following content:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

"use client"
import React, { useState } from 'react';
import { jobListings } from "@/compoments/joblisting"

export default function Page() {
    const [searchQuery, setSearchQuery] = useState('');
    const [selectedEmployment, setSelectedEmployment] = useState&amp;lt;string[]&amp;gt;([]);
    const [selectedLocations, setSelectedLocations] = useState&amp;lt;string[]&amp;gt;([]);



    // Filter job listings based on search query, selected employment types, and selected locations
    const filteredJobListings = jobListings.filter(job =&amp;gt;
        job.title.toLowerCase().includes(searchQuery.toLowerCase()) &amp;amp;&amp;amp;
        (selectedEmployment.length === 0 || selectedEmployment.includes(job.employment)) &amp;amp;&amp;amp;
        (selectedLocations.length === 0 || selectedLocations.includes(job.location))
    );

    // Get unique employment types and locations
    const uniqueEmploymentTypes = Array.from(new Set(jobListings.map(job =&amp;gt; job.employment)));
    const uniqueLocations = Array.from(new Set(jobListings.map(job =&amp;gt; job.location)));


    return (
        &amp;lt;div className=' px-4 py-4'&amp;gt;
        &amp;lt;h1&amp;gt;Job Listings&amp;lt;/h1&amp;gt;
        {/* Search bar */}
        &amp;lt;input
          type="text"
          placeholder="Search..."
          value={searchQuery}
          onChange={(e) =&amp;gt; setSearchQuery(e.target.value)}
        /&amp;gt;
        {/* Employment type checkboxes */}
        &amp;lt;div&amp;gt;
          &amp;lt;h3&amp;gt;Employment Type&amp;lt;/h3&amp;gt;
          {uniqueEmploymentTypes.map(type =&amp;gt; (
            &amp;lt;label key={type}&amp;gt;
              &amp;lt;input
                type="checkbox"
                value={type}
                checked={selectedEmployment.includes(type)}
                onChange={(e) =&amp;gt; {
                  if (e.target.checked) {
                    setSelectedEmployment([...selectedEmployment, type]);
                  } else {
                    setSelectedEmployment(selectedEmployment.filter(item =&amp;gt; item !== type));
                  }
                }}
              /&amp;gt;
              {type}
            &amp;lt;/label&amp;gt;
          ))}
        &amp;lt;/div&amp;gt;
        {/* Location checkboxes */}
        &amp;lt;div&amp;gt;
          &amp;lt;h3&amp;gt;Location&amp;lt;/h3&amp;gt;
          {uniqueLocations.map(location =&amp;gt; (
            &amp;lt;label key={location}&amp;gt;
              &amp;lt;input
                type="checkbox"
                value={location}
                checked={selectedLocations.includes(location)}
                onChange={(e) =&amp;gt; {
                  if (e.target.checked) {
                    setSelectedLocations([...selectedLocations, location]);
                  } else {
                    setSelectedLocations(selectedLocations.filter(item =&amp;gt; item !== location));
                  }
                }}
              /&amp;gt;
              {location}
            &amp;lt;/label&amp;gt;
          ))}
        &amp;lt;/div&amp;gt;
        {/* Display filtered job listings */}
        {filteredJobListings.map(job =&amp;gt; (
          &amp;lt;div key={job.id}&amp;gt;
            &amp;lt;h2&amp;gt;{job.title}&amp;lt;/h2&amp;gt;
            &amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Company:&amp;lt;/strong&amp;gt; {job.company}&amp;lt;/p&amp;gt;
            &amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Employment:&amp;lt;/strong&amp;gt; {job.employment}&amp;lt;/p&amp;gt;
            &amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Location:&amp;lt;/strong&amp;gt; {job.location}&amp;lt;/p&amp;gt;
            &amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Description:&amp;lt;/strong&amp;gt; {job.description}&amp;lt;/p&amp;gt;
            &amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Salary:&amp;lt;/strong&amp;gt; {job.salary}&amp;lt;/p&amp;gt;
          &amp;lt;/div&amp;gt;
        ))}
      &amp;lt;/div&amp;gt;
    );
  }


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;step 4: On the last stage we need dummy data, create a map called compoments add a new file in this directory called joblisting.tsx&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

interface Job {
    id: number;
    title: string;
    company: string;
    employment: string;
    location: string;
    description: string;
    salary: string;
}

const jobListings: Job[]  = [
    {
      id: 1,
      title: "Software Engineer",
      company: "Tech Co.",
      employment: "Full-time",
      location: "New York, NY",
      description: "We are seeking a talented software engineer to join our team...",
      salary: "$80,000 - $100,000 per year"
    },
    {
      id: 2,
      title: "Data Analyst",
      company: "Data Corp.",
      employment: "Contract",
      location: "San Francisco, CA",
      description: "Data Corp. is looking for a skilled data analyst to analyze...",
      salary: "$70,000 - $90,000 per year"
    },
    {
      id: 3,
      title: "UX/UI Designer",
      company: "Design Studio",
      employment: "Part-time",
      location: "Los Angeles, CA",
      description: "Design Studio is seeking a creative UX/UI designer to help...",
      salary: "$60,000 - $80,000 per year"
    }
  ];

  // Extract unique locations
  const locations = Array.from(new Set(jobListings.map(job =&amp;gt; job.location)));

  export { jobListings , locations };


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Step 4: Running the Application&lt;br&gt;
To run the application, go back to your terminal and run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

npm run dev



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>tailwindcss</category>
      <category>nextjs14</category>
    </item>
    <item>
      <title>I created my first open source project on github.</title>
      <dc:creator>RedbeardJunior</dc:creator>
      <pubDate>Tue, 08 Aug 2023 13:15:45 +0000</pubDate>
      <link>https://dev.to/redbeardjunior/i-created-my-first-open-source-project-on-github-1fd7</link>
      <guid>https://dev.to/redbeardjunior/i-created-my-first-open-source-project-on-github-1fd7</guid>
      <description>&lt;p&gt;&lt;strong&gt;Project DOCK&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I just uploaded my first opensource project called dock.&lt;/p&gt;

&lt;p&gt;it is still a basic project with a great vision and mission.&lt;/p&gt;

&lt;p&gt;Dock is gonna be a out of the box template roll out to start your new project easy and efficiently as possible.&lt;/p&gt;

&lt;p&gt;My vision and mission for dock is that it will be a handy template to use for different docker project. &lt;/p&gt;

&lt;p&gt;Just enjoy and leave if you like my vision and mission please leave a star.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Redbeardjunior/Dock"&gt;Dock repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;keep on docking with dock.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>node</category>
      <category>template</category>
      <category>nginx</category>
    </item>
    <item>
      <title>Starting a SaaS.</title>
      <dc:creator>RedbeardJunior</dc:creator>
      <pubDate>Tue, 11 Jul 2023 11:40:43 +0000</pubDate>
      <link>https://dev.to/redbeardjunior/starting-a-saas-1abn</link>
      <guid>https://dev.to/redbeardjunior/starting-a-saas-1abn</guid>
      <description>&lt;p&gt;I always wanted to build my own SaaS, but my job don't let me.&lt;/p&gt;

&lt;p&gt;I started in the back ground and would like to share my journey, I have a idea and I'm working on it as we speak.&lt;/p&gt;

&lt;p&gt;I would love to share the journey with you all and love to learn on the go.&lt;/p&gt;

&lt;p&gt;So the journey begin by creating the graphical interface.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>saas</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Electronjs ActiveX printing controls chrome based. Help needed.</title>
      <dc:creator>RedbeardJunior</dc:creator>
      <pubDate>Thu, 23 Feb 2023 15:30:01 +0000</pubDate>
      <link>https://dev.to/redbeardjunior/electronjs-activex-printing-controls-chrome-based-44g8</link>
      <guid>https://dev.to/redbeardjunior/electronjs-activex-printing-controls-chrome-based-44g8</guid>
      <description>&lt;p&gt;Edge has a new future to use IE components like ActiveX with the new update:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--slQ5-IHa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vo8tdjoq3w21d9dg1udd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--slQ5-IHa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vo8tdjoq3w21d9dg1udd.png" alt="Image description" width="880" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because edge is build on chromium and use a plugin from MeadCo ScriptX&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zSb9fhx8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2mibbw7aoe93hnmsfvq0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zSb9fhx8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2mibbw7aoe93hnmsfvq0.png" alt="Image description" width="880" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I want to build this for chrome as well, because we have a older version of printing that use the ActiveX Printing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;its a hybrid application that is made on chromium / chrome.&lt;/p&gt;

&lt;p&gt;With node node js and electronjs I know it is posible but how is the qeustion !&lt;/p&gt;

&lt;p&gt;please give me some directions to get it rolling !&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9dnNJ2pe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hn22zzvkqqe2b8fuz725.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9dnNJ2pe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hn22zzvkqqe2b8fuz725.png" alt="Image description" width="880" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don't immediately criticize my question still learning.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
