Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join-quiz-UI #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Join-quiz-UI #10

wants to merge 1 commit into from

Conversation

RaoJordan
Copy link

UI Images :
Screenshot 2023-12-27 232644

Screenshot 2023-12-27 232628

UI for Join-Quiz Interface using react and tailwind

@RaoJordan
Copy link
Author

Code :
import React, { useState } from 'react';

const Login = () => {
const [joinCode, setJoinCode] = useState('');

const handleJoinCodeChange = (event) => {
setJoinCode(event.target.value);
};

const handleSubmit = (event) => {
event.preventDefault();

console.log('Join Code:', joinCode);

// Clear the input field after submission 
setJoinCode('');

};

return (





Mentimeter


    <div className="text-center text-sm text-gray-400 mb-4">
      It's on the screen in front of you
    </div>

    <form className="text-center" onSubmit={handleSubmit}>
      <div className="mb-4">
        <label htmlFor="code" className="block text-md font-medium text-gray-600">
          Enter the code to join
        </label>
        <input
          type="text"
          id="code"
          name="code"
          value={joinCode}
          onChange={handleJoinCodeChange}
          className="mt-1 p-2 w-full border rounded-md"
          placeholder="Enter code"
        />
      </div>
      <button
        type="submit"
        className="w-1/2 bg-zinc-800 text-white p-2 rounded-full hover:bg-zinc-600"
      >
        Join
      </button>
    </form>
  </div>
</div>

);
};

export default Login;

TypeScript:
import React, { useState, ChangeEvent, FormEvent } from 'react';

interface LoginProps {}

const Login: React.FC = () => {
const [joinCode, setJoinCode] = useState('');

const handleJoinCodeChange = (event: ChangeEvent) => {
setJoinCode(event.target.value);
};

const handleSubmit = (event: FormEvent) => {
event.preventDefault();

console.log('Join Code:', joinCode);

// Clear the input field after submission
setJoinCode('');

};

return (





Mentimeter


    <div className="text-center text-sm text-gray-400 mb-4">
      It's on the screen in front of you
    </div>

    <form className="text-center" onSubmit={handleSubmit}>
      <div className="mb-4">
        <label htmlFor="code" className="block text-md font-medium text-gray-600">
          Enter the code to join
        </label>
        <input
          type="text"
          id="code"
          name="code"
          value={joinCode}
          onChange={handleJoinCodeChange}
          className="mt-1 p-2 w-full border rounded-md"
          placeholder="Enter code"
        />
      </div>
      <button
        type="submit"
        className="w-1/2 bg-zinc-800 text-white p-2 rounded-full hover:bg-zinc-600"
      >
        Join
      </button>
    </form>
  </div>
</div>

);
};

export default Login;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant